ToolStripControlHost.DefaultSize Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the default size of the control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

protected override Size DefaultSize { get; }

Property Value

Type: System.Drawing.Size

The default Size of the control.

The DefaultSize property represents the Size of the control when it is initially created. If AutoSize is true, the control is sized automatically in accordance with the ToolStrip orientation. You can manually adjust the size of the control by setting its AutoSize property value to false.

System_CAPS_noteNote

In order to maintain better performance, you should not set the Size of a control in its constructor. The preferred method is to override the DefaultSize property.

Notes to Inheritors:

When overriding the DefaultSize property in a derived class, it is preferable to return a Size with the desired dimensions rather than overriding all the implementation.

.NET Framework
Available since 2.0
Return to top
Show: