TextBox inheritance

S

Stephen Ahn

Using dotnet 1.1.

Say I have assembly "A" with a drived textbox like this :

public class MyTextBox: TextBox
{
public MyTextBox(): base()
{
this.BackColor = System.Drawing.Color.AliceBlue; // XXX
}
}

Assembly "A" is compiled.

Say I have a windows form in application "B", onto which I drop "MyTextBox".
The text box shows up in AliceBlue, as expected, at both design time and
runtime.

Now, later on, say line XXX at assembly "A" is changed, to this :

this.BackColor = System.Drawing.Color.Brown;

Assembly "A" is compiled again.

Now, if I open up the form in application "B", is it possible for the the
textbox to reflect the changes made to assembly "A", without having to
remove the control and add it again ? i.e. so that the textbox automatically
shows up as brown.

What are the general approaches to doing this kind of thing ? Or is this
something that can't be done ?

TIA,
Stephen
 
C

Christian Fleischhacker

Stephen said:
Using dotnet 1.1.

Say I have assembly "A" with a drived textbox like this :

public class MyTextBox: TextBox
{
public MyTextBox(): base()
{
this.BackColor = System.Drawing.Color.AliceBlue; // XXX
}
}

Assembly "A" is compiled.

Say I have a windows form in application "B", onto which I drop "MyTextBox".
The text box shows up in AliceBlue, as expected, at both design time and
runtime.

Now, later on, say line XXX at assembly "A" is changed, to this :

this.BackColor = System.Drawing.Color.Brown;

Assembly "A" is compiled again.

Now, if I open up the form in application "B", is it possible for the the
textbox to reflect the changes made to assembly "A", without having to
remove the control and add it again ? i.e. so that the textbox automatically
shows up as brown.

What are the general approaches to doing this kind of thing ? Or is this
something that can't be done ?

TIA,
Stephen
you could try to clean the solution and recompile everything (maybe you
have to do this more than once) this behavior still shows up in 2.0
Framework from time to time
 

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