System.Windows.Forms.TextBoxBase.Multiline Property

Gets or sets a value indicating whether this is a multiline text box control.

Syntax

[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)]
[System.ComponentModel.Localizable(true)]
[System.ComponentModel.DefaultValue(false)]
public virtual bool Multiline { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

A multiline text box allows you to display more than one line of text in the control. If the TextBoxBase.WordWrap property is set to true, text entered into the multiline text box is wrapped to the next line in the control. If the TextBoxBase.WordWrap property is set to false, text entered into the multiline text box control will be displayed on the same line until a newline character is entered.

The following can be used as newline characters:

You can add scroll bars to a text box using the TextBox.ScrollBars property to display horizontal and/or vertical scroll bars. This allows the user to scroll through the text that extends beyond the dimensions of the control.

Note:

Because the default value of the TextBoxBase.Multiline property is false, the default size of a System.Windows.Forms.TextBox will be in accordance with the font size even if you resize the System.Windows.Forms.TextBox. To get a consistent size for your System.Windows.Forms.TextBox, set its TextBox.Multiline property to true.

Note:

On Japanese operating systems, if the TextBoxBase.Multiline property is set to true, setting the TextBox.PasswordChar property will display the text of the password, thus compromising system security. Therefore, on Japanese operating systems, set the TextBoxBase.Multiline property to false if you set the TextBox.PasswordChar property.

Note:

This property is set to false by default for all derived classes, with the exception of the System.Windows.Forms.RichTextBox control.

For a System.Windows.Forms.RichTextBox control, the RichTextBox.Multiline property affects whether or not the control will automatically resize, as follows:

Requirements

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