I'm curious that your derived forms do not automatically inherit size from their base form, because this should work without having to do anything with it.
The alleged cause of your problem:
I suspect that your problem is due to the fact that you are using Visual Studio Forms Designer to edit forms. Whenever you edit a form, Windows Forms Designer generates the required code in the InitializeComponent method of your forms. Among all the generated code are destinations that specify the size of the form, even if it is identical to the size of the base form. Therefore, you may need to manually comment on these assignments if you want your derived form to be the same size as the base form, even if you resized the base form after creating the derived forms. (However, I do not know if this could lead to further problems with the positioning and layout of the controls.)
// Code to be commented out in your derived form InitializeComponent method: this.AutoScaleDimensions = new System.Drawing.SizeF(...); this.ClientSize = new System.Drawing.Size(...);
After these lines are commented out, the size specified in your basic InitializeComponent form will be used for the derived form.
Workaround:
You can do the following so that every time you edit the form, you do not have to manually comment on the code generated by the generated design:
Create a form derived from your base form; call him FrozenBaseForm . You will receive all other forms from this class, and not directly from the base form. Now in this "intermediate" class you define a new ClientSize property:
public class FrozenBaseForm : BaseForm { new public SizeF ClientSize { get { return base.ClientSize; } set { } } }
This will cause all ClientSize assignments to have no effect and therefore save the size from the base form. It seems to crack the truth, but it seems to work. You may need to hide the Size property in the same way as btw.
As said, derive your forms from FrozenBaseForm , and not from BaseForm directly:
public class DerivedForm1 : FrozenBaseForm { ... } public class DerivedForm2 : FrozenBaseForm { ... } ...
Another option (the latter, if all else fails):
As a last resort, you can simply forget about Forms Designer and simply define derived forms manually in the code editor (although I personally would not want to do this):
public class DerivedForm : BaseForm { public DerivedForm() {