D
davy
I've made one form which has a private button control.
I've changed the anchor property of the button control to bottom
right.
I've created a new form derived from the first one and I resize it in
the designer. The button control remains anchored correctly and the
position on the form changes when I change the size of the form (which
is correct).
If I save and reload the derived form in this stage the control is
still in the position where it was when I saved the form (also this is
correct).
Now, I add a new control on the derived form, and save the form. When
I reload the form in the designer the first control is in the position
where it was on the base form (which is not correct anymore).
The change that the designer made in the derived form
InitializeComponent() method is that it added SuspendLayout() and
ResumeLayout(), if I remove those method calls all is right again, but
the designer will regenerate the code on the next save, so is not a
solution.
Does anyone know a workaround to this problem? (I need that first
control remains private and bottom right anchored).
I've changed the anchor property of the button control to bottom
right.
I've created a new form derived from the first one and I resize it in
the designer. The button control remains anchored correctly and the
position on the form changes when I change the size of the form (which
is correct).
If I save and reload the derived form in this stage the control is
still in the position where it was when I saved the form (also this is
correct).
Now, I add a new control on the derived form, and save the form. When
I reload the form in the designer the first control is in the position
where it was on the base form (which is not correct anymore).
The change that the designer made in the derived form
InitializeComponent() method is that it added SuspendLayout() and
ResumeLayout(), if I remove those method calls all is right again, but
the designer will regenerate the code on the next save, so is not a
solution.
Does anyone know a workaround to this problem? (I need that first
control remains private and bottom right anchored).