Gets or sets a value indicating whether this is a multiline text box control.
[Visual Basic] Overridable Public Property Multiline As Boolean [C#] public bool Multiline {virtual get; virtual set;} [C++] public: __property virtual bool get_Multiline(); public: __property virtual void set_Multiline(bool); [JScript] public function get Multiline() : Boolean; public function set Multiline(Boolean);
true if the control is a multiline text box control; otherwise false. The default is false.
A multiline text box allows you to display more than one line of text in the control. If the WordWrap property is set to true, text entered into the multiline text box is wrapped to the next line in the control. If the 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.
You can add scroll bars to a text box using the System.WinForms.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.
The following example uses TextBox, a derived class, to create a multiline TextBox control with vertical scroll bars. This example also uses the AcceptsTab, AcceptsReturn, and WordWrap properties to make the multiline text box control useful for creating text documents.
[Visual Basic]
Public Sub CreateMultilineTextBox() ' Create an instance of a TextBox control Dim Text1 as TextBox Set Text1 = New TextBox() ' Set the Multiline property to True. Text1.Multiline = True ' Add vertical scroll bars to the TextBox control. Text1.Scrollbars = ScrollBars.Vertical ' Allow the RETURN key in the TextBox control. Text1.AcceptsReturn = True ' Allow the TAB key to be entered in the TextBox control. Text1.AcceptsTab = True ' Set WordWrap to True to allow text to wrap to the next line. Text1.WordWrap = True ' Set the default text of the control. Text1.Text = "Welcome!" End Sub
TextBoxBase Class | TextBoxBase Members | System.WinForms Namespace | Lines | WordWrap | ScrollBars