TextBoxBase.AcceptsTab Eigenschap
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee wordt een waarde opgehaald of ingesteld die aangeeft of u op de TAB-toets in een besturingselement met meerdere regels drukt, een TAB-teken in het besturingselement typt in plaats van de focus naar het volgende besturingselement in de tabvolgorde te verplaatsen.
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
Waarde van eigenschap
true als gebruikers tabs kunnen invoeren in een tekstvak met meerdere regels met behulp van de TAB-toets; false als u op de Tab-toets drukt, wordt de focus verplaatst. De standaardwaarde is false.
Voorbeelden
In het volgende codevoorbeeld wordt een afgeleide klasse gebruikt TextBoxom een besturingselement met meerdere regels TextBox te maken met verticale schuifbalken. In dit voorbeeld worden ook de AcceptsTabeigenschappen en AcceptsReturnWordWrapeigenschappen gebruikt om het besturingselement voor meerdere regels handig te maken voor het maken van tekstdocumenten.
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
Opmerkingen
De Multiline eigenschap moet ook zijn true om een TAB-teken in het besturingselement op te halen.
Als de AcceptsTab eigenschap is ingesteld op true, moet de gebruiker op Ctrl+Tab drukken om de focus naar het volgende besturingselement in de tabvolgorde te verplaatsen.