This property returns and sets a value indicating whether a TextBox control can accept and display multiple lines of text.
object.MultiLine
The following table shows the settings for the MultiLine property.
Setting |
Description |
True | Enables multiple lines of text |
False (default) | Ignores carriage returns and restricts data to a single line |
The MultiLine property is read-only at run time.
A multiple-line TextBox control wraps text if the user types text that extends beyond the text box.
You also can add scroll bars to larger TextBox controls using the ScrollBars property. If you do not specify a horizontal scroll bar, the text in a multiple-line TextBox control automatically wraps.
On a form with no default button, pressing ENTER while the cursor is in a multiple-line TextBox control moves the focus to the next line. If a default button exists, you must press CTRL+ENTER to move to the next line.