System.Windows.Forms.Label.AutoSize Property

Gets or sets a value indicating whether the control is automatically resized to display its entire contents.

Syntax

[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)]
[System.ComponentModel.Localizable(true)]
[System.ComponentModel.DefaultValue(false)]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Always)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Visible)]
[System.ComponentModel.Browsable(true)]
public override bool AutoSize { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When this property is set to true, the System.Windows.Forms.Label adjusts its width to display its entire contents. This property is typically set to true when you use a System.Windows.Forms.Label control to display various lengths of text, such as the status of an application process. You can also use this property when the application will display text in various languages, and the size of the text might increase or decrease based on the language settings in Windows.

Note:

If the font is taller than the height of the System.Windows.Forms.Label and Label.AutoEllipsis is true, you must set Label.AutoSize to false for text to be drawn.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0