Freigeben über


ToolStripTextBox.AcceptsReturn Eigenschaft

Definition

Dient zum Abrufen oder Festlegen eines Werts, der angibt, ob durch Drücken der EINGABETASTE in einem mehrzeiligen TextBox Steuerelement eine neue Textzeile im Steuerelement erstellt oder die Standardschaltfläche für das Formular aktiviert wird.

public:
 property bool AcceptsReturn { bool get(); void set(bool value); };
public bool AcceptsReturn { get; set; }
member this.AcceptsReturn : bool with get, set
Public Property AcceptsReturn As Boolean

Eigenschaftswert

true wenn die EINGABETASTE eine neue Textzeile in einer mehrzeiligen Version des Steuerelements erstellt; false wenn die EINGABETASTE die Standardschaltfläche für das Formular aktiviert. Der Standardwert lautet false.

Beispiele

Das folgende Codebeispiel veranschaulicht die Syntax zum Festlegen verschiedener ToolStripTextBox allgemeiner Eigenschafteneinstellungen, einschließlich der AcceptsReturn Eigenschaft.

// This code example demonstrates the syntax for setting
// various ToolStripTextBox properties.
// 
toolStripTextBox1.AcceptsReturn = true;
toolStripTextBox1.AcceptsTab = true;
toolStripTextBox1.AutoCompleteCustomSource.AddRange(new string[] {
"This is line one.",
"Second line.",
"Another line."});
toolStripTextBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
toolStripTextBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
toolStripTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
toolStripTextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
toolStripTextBox1.HideSelection = false;
toolStripTextBox1.MaxLength = 32000;
toolStripTextBox1.Name = "toolStripTextBox1";
toolStripTextBox1.ShortcutsEnabled = false;
toolStripTextBox1.Size = new System.Drawing.Size(100, 25);
toolStripTextBox1.Text = "STRING1\r\nSTRING2\r\nSTRING3\r\nSTRING4";
toolStripTextBox1.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
' This code example demonstrates the syntax for setting
' various ToolStripTextBox properties.
' 
toolStripTextBox1.AcceptsReturn = True
toolStripTextBox1.AcceptsTab = True
toolStripTextBox1.AutoCompleteCustomSource.AddRange(New String() {"This is line one.", "Second line.", "Another line."})
toolStripTextBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
toolStripTextBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource
toolStripTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
toolStripTextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
toolStripTextBox1.HideSelection = False
toolStripTextBox1.MaxLength = 32000
toolStripTextBox1.Name = "toolStripTextBox1"
toolStripTextBox1.ShortcutsEnabled = False
toolStripTextBox1.Size = New System.Drawing.Size(100, 25)
toolStripTextBox1.Text = "STRING1" + ControlChars.Cr + ControlChars.Lf + "STRING2" + ControlChars.Cr + ControlChars.Lf + "STRING3" + ControlChars.Cr + ControlChars.Lf + "STRING4"
toolStripTextBox1.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center

Hinweise

Wenn der Wert dieser Eigenschaft lautet false, muss der Benutzer STRG+EINGABETASTE drücken, um eine neue Zeile in einem mehrzeiligen ToolStripTextBox Steuerelement zu erstellen. Wenn für das Formular keine Standardschaltfläche vorhanden ist, erstellt die EINGABETASTE immer eine neue Textzeile im Steuerelement, unabhängig vom Wert dieser Eigenschaft.

Gilt für: