Is it allowed to edit InitializeComponent()

T

tony

Hello!

I use VS 2003.
I have a control for example System.Windows.Forms.TextBox();
I drag this System.Windows.Forms.TextBox() control into a form.

Now assume I want to add more functionality to this
System.Windows.Forms.TextBox() which mean
I want to create a subclass to this System.Windows.Forms.TextBox() called
ExtTextBox.

How do I do that?

I assume it's not allowed to edit InitializeComponent()
In some way I must say that the control I drag into the form is an instance
of class ExtTextBox.
Where do I do that.

//Tony
 
V

vj

Tony

You need to write a class of your own, that derives from Textbox class,
compile that as DLL.. This Dll if you reference (add reference), will be
available to add as control any project..

// Compile the below class a Class Library
public class ExtTextBox : System.Windows.Forms.TextBox
{

public ExtTextBox()
{

}

// Methods.. and other properties..

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top