Gets or sets a value indicating whether pressing the TAB key in a multiline text box control types a TAB character in the control instead of moving the focus to the next control in the tab order.
[Visual Basic] Public Property AcceptsTab As Boolean [C#] public bool AcceptsTab {get; set;} [C++] public: __property bool get_AcceptsTab(); public: __property void set_AcceptsTab(bool); [JScript] public function get AcceptsTab() : Boolean; public function set AcceptsTab(Boolean);
true if users can enter tabs in the control using the TAB key; false if pressing the TAB key moves the focus. The default is false.
If the System.WinForms.TextBoxBase.AcceptTab property is set to true, the user must press CTRL+TAB to move the focus to the next control in the tag order.
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 an 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 | AcceptsReturn