TextBoxBase.PreferredHeight Property

Definition

Gets the preferred height for a text box.

C#
[System.ComponentModel.Browsable(false)]
public int PreferredHeight { get; }

Property Value

The preferred height of a text box.

Attributes

Remarks

The size returned by this property is based on the font height and border style of the text box. You can use this property to determine the appropriate size of the text box to ensure that text is properly displayed in the control. The value returned by this property is in pixels.

The value of PreferredHeight represents the minimum height the text box must have in order to display a single line of text without clipping the text on the top or bottom. This value is the same whether the Multiline property is set to true or false.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also