TextBox inheritance

  • Thread starter Thread starter Stephen Ahn
  • Start date Start date
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
 
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
 
Back
Top