Visual Inheritance in WinForms

  • Thread starter Thread starter Patrick Corkum
  • Start date Start date
P

Patrick Corkum

If I have a form, say FORM_FOO, and a form that it inherits from, say
FORM_BAR and on FORM_BAR, I have a button, say BTN_RETURN. Now, how do
I make FORM_FOO actually do true inheritance when I change BTN_RETURN
on FORM_BAR? In order to actually do that, I have to open every form
that inherits from FORM_BAR and remove the code manually from
InitializeComponents(). <Never mind the fact that it needs to be
checked in and out of source safe>. There MUST be a way to make it
actually work correctly.

Please help!
Thanks in advance,
~Patrick Corkum
 
Hi Patrick

How are you changing the BTN_RETURN, and what exactly is the code that you
have to remove from the InitializeComponent() method?

Charles
 
Visual Studio 2003 is much better than 2002 in this
regards. 2002 put EVERYTHING in the InitializeComponent()
and any images in the .resx. However, since converting to
2003, I only have 2 lines of code:

this.BTN_RETURN.Name = "BTN_RETURN";
this.Controls.SetChildIndex(this.BTN_RETURN, 0);

Thanks,
~Patrick Corkum
 
Back
Top