Visual Studio Express is a lightweight version of VS products and although it is very powerful, it is missing several features from paid editions and one of them is ability to add a Component Class using Add New Item dialog box.
But users of Express editions can still create Component Class by following the steps below:
- Using Add New Item dialog box, add a User Control and name it Component1 .
Component1.cs and choose View Code to view the code. Now delete everything and replace it with the following code.
public partial class Component1 : Component
public Component1(IContainer container)
- Rename the namespace to the one you are using. Visual Studio will give your namespace same name as your project name.
- Go to
Component1.Designer.cs and remove the following line in
InitializeComponent method. Method is located in Component Designer generated code region, so expand that region if necessary.
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
And you are done.
If you found this article useful, drop a comment or connect with the blog on the social networks.