System.Windows.Forms.TextBoxBase.Lines Property

Gets or sets the lines of text in a text box control.

Syntax

[System.ComponentModel.Localizable(true)]
[System.ComponentModel.Editor("System.Windows.Forms.Design.StringArrayEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.MergableProperty(false)]
public string[] Lines { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Each element in the array becomes a line of text in the text box control. If the TextBoxBase.Multiline property of the text box control is set to true and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line.

Note:

By default, the collection of lines is a read-only copy of the lines in the System.Windows.Forms.TextBox. To get a writable collection of lines, use code similar to the following: textBox1.Lines = new string[] { "abcd" };

Requirements

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