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!

TextBoxBase Class

Implements the basic functionality required by text controls.

Object
   MarshalByRefObject
      MarshalByRefComponent
         Control
            RichControl
               FormatControl
                  TextBoxBase

[Visual Basic]
MustInherit Public Class TextBoxBase
   Inherits FormatControl
[C#]
public abstract class TextBoxBase : FormatControl
[C++]
public __gc __abstract class TextBoxBase : public FormatControl
[JScript]
public abstract class TextBoxBase extends FormatControl

Remarks

This class implements the core features of text manipulation controls such as TextBox and RichTextBox. These include text selection, Clipboard functionality, multiline text control support, and many events.

Notes to Inheritors[note] You do not typically inherit from TextBoxBase. To create your own text control class, inherit from TextBox or RichTextBox.

Requirements

Namespace: System.WinForms

Assembly: System.WinForms.dll

Example [Visual Basic]

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

See Also

TextBoxBase Members | System.WinForms Namespace | TextBox | RichTextBox