System.Windows.Forms.TextBoxBase.AutoSize Property

Gets or sets a value indicating whether the height of the control automatically adjusts when the font assigned to the control is changed.

Syntax

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

Value

Documentation for this section has not yet been entered.

Remarks

When you set the TextBoxBase.AutoSize property to true for a System.Windows.Forms.TextBox, when the Control.Font changes, the System.Windows.Forms.TextBox expands or contracts the Control.Height to accommodate the larger or smaller text. The Control.Width of the System.Windows.Forms.TextBox does not change.

If you want to change the size of the control as the user enters text, you can use a System.Windows.Forms.RichTextBox control and use its RichTextBox.ContentsResized event to change its size.

Requirements

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