TextBoxBase.AcceptsTab Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob das Drücken der TAB-TASTE in einem mehrteiligen Textfeld-Steuerelement ein TAB-Zeichen im Steuerelement eingibt, anstatt den Fokus auf das nächste Steuerelement in der Aktivierreihenfolge zu verschieben.
public:
property bool AcceptsTab { bool get(); void set(bool value); };
public bool AcceptsTab { get; set; }
member this.AcceptsTab : bool with get, set
Public Property AcceptsTab As Boolean
Eigenschaftswert
true wenn Benutzer Registerkarten in ein mehrteiliges Textfeld mithilfe der TAB-TASTE eingeben können; false wenn durch Drücken der TAB-TASTE der Fokus verschoben wird. Der Standardwert lautet false.
Beispiele
Im folgenden Codebeispiel wird TextBox eine abgeleitete Klasse verwendet, um ein mehrzeiliges TextBox Steuerelement mit vertikalen Bildlaufleisten zu erstellen. In diesem Beispiel werden auch die Eigenschaften AcceptsTab, AcceptsReturn und WordWrap verwendet, um das Mehrzeilen-Textfeld-Steuerelement nützlich für die Erstellung von Textdokumenten zu machen.
public:
void CreateMyMultilineTextBox()
{
// Create an instance of a TextBox control.
TextBox^ textBox1 = gcnew TextBox;
// Set the Multiline property to true.
textBox1->Multiline = true;
// Add vertical scroll bars to the TextBox control.
textBox1->ScrollBars = ScrollBars::Vertical;
// Allow the RETURN key in the TextBox control.
textBox1->AcceptsReturn = true;
// Allow the TAB key to be entered in the TextBox control.
textBox1->AcceptsTab = true;
// Set WordWrap to true to allow text to wrap to the next line.
textBox1->WordWrap = true;
// Set the default text of the control.
textBox1->Text = "Welcome!" + Environment::NewLine + "Second Line";
}
public void CreateMyMultilineTextBox()
{
// Create an instance of a TextBox control.
TextBox textBox1 = new TextBox();
// Set the Multiline property to true.
textBox1.Multiline = true;
// Add vertical scroll bars to the TextBox control.
textBox1.ScrollBars = ScrollBars.Vertical;
// Allow the RETURN key in the TextBox control.
textBox1.AcceptsReturn = true;
// Allow the TAB key to be entered in the TextBox control.
textBox1.AcceptsTab = true;
// Set WordWrap to true to allow text to wrap to the next line.
textBox1.WordWrap = true;
// Set the default text of the control.
textBox1.Text = "Welcome!" + Environment.NewLine + "Second Line";
}
Public Sub CreateMyMultilineTextBox()
' Create an instance of a TextBox control.
Dim textBox1 As New TextBox()
' Set the Multiline property to true.
textBox1.Multiline = True
' Add vertical scroll bars to the TextBox control.
textBox1.ScrollBars = ScrollBars.Vertical
' Allow the RETURN key in the TextBox control.
textBox1.AcceptsReturn = True
' Allow the TAB key to be entered in the TextBox control.
textBox1.AcceptsTab = True
' Set WordWrap to true to allow text to wrap to the next line.
textBox1.WordWrap = True
' Set the default text of the control.
textBox1.Text = "Welcome!" & Environment.NewLine & "Second Line"
End Sub
Hinweise
Die Multiline Eigenschaft muss auch das Abrufen eines TAB-Zeichens im Steuerelement sein true .
Wenn die AcceptsTab Eigenschaft auf true festgelegt ist, muss der Benutzer STRG+TAB drücken, um den Fokus in der Aktivierreihenfolge auf das nächste Steuerelement zu setzen.