TextBoxBase.PreferredHeight 属性

定义

获取文本框的首选高度。Gets the preferred height for a text box.

public:
 property int PreferredHeight { int get(); };
[System.ComponentModel.Browsable(false)]
public int PreferredHeight { get; }
[<System.ComponentModel.Browsable(false)>]
member this.PreferredHeight : int
Public ReadOnly Property PreferredHeight As Integer

属性值

Int32

文本框的首选高度。The preferred height of a text box.

属性

注解

此属性返回的大小基于文本框的字体高度和边框样式。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.

的值 PreferredHeight 表示文本框必须具有的最小高度,以便在不剪辑顶部或底部的情况下显示单行文本。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. 无论 Multiline 属性是设置为还是,此值都是相同的 true falseThis value is the same whether the Multiline property is set to true or false.

适用于

另请参阅