Hi!
I have run into a problem with visual inheritance using the VS2005 designer
for Windows Forms.
My goal is to put business logic and common rules for our controls into its
own layer (base classes) so that future changes in these controls are managed
by just modifying this custom layer, and not all the controls of a particular
type.
This is the situation:
I've created my own custom library project with controls providing some
business rules, e.g a GridViewControl which is customized. When - in my
application project - building forms using grid controls that inherits from
my custom GridViewControl it first seems OK. But when I in the designer move
the inherited control to a different position on the form, properties-values
from the custom control (base-class) that are not-default (modified by me)
are generated/copied into the forms "InitializeComponent" method.
And; here comes the unwanted effect:
This means that if I later on change the value of these properties in the
base-class, the inherited controls will not notice these changes, because of
the previous "copy"-operation from the base class to the child class.
Is there any way that I can prevent properties set in the base class from
being copied to the "InitializeComponent"-method in the application Form when
using the Forms designer (e.g. when moving the control to another position)?
Thanks,
Helge