How to create a custom control ?

  • Thread starter Thread starter Mike Oliszewski
  • Start date Start date
M

Mike Oliszewski

I want to take the ListView and enhance it and then make it available as a
drop in GUI Control for Visual Studio with all the easy configuration of
properties that are normally available. Here is my test control which works
as expected if I manually add it to a form. How do I get it in the ToolBox
such that I can drop it onto a form ?

namespace Test
{
public class ExListView : System.Windows.Forms.ListView
{
public ExListView()
{
this.BackColor = Color.Red;
}
}
}
 
Hi Mike,

Choose a tab of the toolbox you want to place your control in, then
right-click on this tab and choose "Customize...". Then switch to the ".NET
Components" tab in the dialog appeared, click "Browse..." and specify the
path to the assembly containing your customized control.
 
Thank you!
Dmitriy Lapshin said:
Hi Mike,

Choose a tab of the toolbox you want to place your control in, then
right-click on this tab and choose "Customize...". Then switch to the ".NET
Components" tab in the dialog appeared, click "Browse..." and specify the
path to the assembly containing your customized control.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Mike Oliszewski said:
I want to take the ListView and enhance it and then make it available as a
drop in GUI Control for Visual Studio with all the easy configuration of
properties that are normally available. Here is my test control which works
as expected if I manually add it to a form. How do I get it in the ToolBox
such that I can drop it onto a form ?

namespace Test
{
public class ExListView : System.Windows.Forms.ListView
{
public ExListView()
{
this.BackColor = Color.Red;
}
}
}
 
Back
Top