I am experiencing some annoying behavior with Visual Studio .NET 2008.
We have created a base form, and a base grid derived from Infragistics UltraGrid.
In the base form, we have set some properties like colors, font size, etc.
1. We create a new Windows Form, (i.e. DerivedForm)
2. We change the inheritance to BaseForm, by simply adding a using statement and changing the inheritance in the class definition.
3. The IDE at this point copies all of the property settings you would see in BaseForm.designer.cs to DerivedForm.designer.cs.
4. Now if we make a change to a BaseForm property, it is overridden by the existing settings, copied in step 3. Therefore we don’t see the new change in the child form.
An example of what is being copied comes from BaseForm.InitializeControls() like the following, which I find in the derived Form class’s InitializeControls():
//
// BaseForm_Fill_Panel
//
this.BaseForm_Fill_Panel.Location = new System.Drawing.Point(0, 47);
this.BaseForm_Fill_Panel.Size = new System.Drawing.Size(1095, 505);
Is there a way to prevent the IDE from copying properties to the child form?
Just my 2cents… When I built my baseclasses to have a uniform consistency of colors, fonts, sizes and such, in my baseclass definition, I did an override on the properties to make them read-only. So, when the original form is created and includes all that extra garbage/bloat, when you compile it first time, it will nag about a value as read-only and require you to strip said lines. Then, any subsequent changes to any of the classes (including read-only fonts), ALL the forms, textboxes, labels, buttons, etc will reflect them. Such override to make read-only would be…
I don’t know if this is what you are really trying to get accomplished, but in my stuff, works great.