Let’s assume I’ve a Form
and it contains a ToolStrip
. In the Form1.Designer.cs
file I can see the following to lines:
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
Let’s assume I generate a custom ToolStrip using the following code:
[Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
public class MyToolStrip : ToolStrip
{
}
see WinForms ToolStrip not available in visual inheritence
If I use now MyToolStrip
instead of ToolStrip
in my Form
then the this.toolStrip1.PerformLayout()
line is removed from the designer file. Why? And how can I bring it back without editing every time the designer file which I shouldn’t do?
If the line is missing the size of some controls is not right, e.g.: ToolStripComboBox
Se as well C#: Does ResumeLayout(true) do the same as ResumeLayout(false) + PerformLayout()?