NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

TextBox Control

Win Forms text boxes are used to get input from the user or to display text. The TextBox control is generally used for editable text, although it can also be made read-only. Text boxes can display multiple lines, wrap text to the size of the control, and add basic formatting such as quotation marks and placeholder characters for passwords.

The text displayed by the control is contained in the Text property. By default, you can enter up to 2048 characters in a text box. If you set the MultiLine property to True, you can enter up to 32K of text. The Text property can be set at run time in code, or by user input at run time. The current contents of a text box can be retrieved at run time by reading the Text property.

The code below sets text in the control at run time. The InitializeMyControl procedure will not execute automatically: it must be called.

Private Sub InititalizeMyControl()
   ' Put some text into the control first.
   TextBox1.Text = "This is a TextBox control."
End Sub

See Also

Controlling the Insertion Point in a TextBox Control | Creating a Password Text Box with the TextBox Control | Creating a Read-Only Text Box | Putting Quotation Marks in a String Programmatically | Selecting Text Programmatically in the TextBox Control | Viewing Multiple Lines in the TextBox Control