J
J Carey
I'm trying to create a custom control by inheriting from an existing
one. My actual situation is a little more complex but is similar to
this:
1) You put a Button on a form and in the InitializeComponent() for the
form the only code it really adds is the location, tabindex, name, and
text. It has several properties it doesn't throw in there, such as
the BackColor. I'm assuming that this is because it just uses the
default value. If I'm wrong correct me.
2) Given this, let's say I want to create a control called RedButton
that inherits from Button. In my inherited class I set the BackColor
to Color.Red and compile it. When I go to put this new RedButton in a
form, I don't want to see its BackColor being set in the
InitializeComponent() of the form it belongs to. Is there any way to
do this?
Thanks for any advice,
Jeff
one. My actual situation is a little more complex but is similar to
this:
1) You put a Button on a form and in the InitializeComponent() for the
form the only code it really adds is the location, tabindex, name, and
text. It has several properties it doesn't throw in there, such as
the BackColor. I'm assuming that this is because it just uses the
default value. If I'm wrong correct me.
2) Given this, let's say I want to create a control called RedButton
that inherits from Button. In my inherited class I set the BackColor
to Color.Red and compile it. When I go to put this new RedButton in a
form, I don't want to see its BackColor being set in the
InitializeComponent() of the form it belongs to. Is there any way to
do this?
Thanks for any advice,
Jeff