ToolStripTextBox.AcceptsReturn ToolStripTextBox.AcceptsReturn ToolStripTextBox.AcceptsReturn ToolStripTextBox.AcceptsReturn Property

Definición

Obtiene o establece un valor que indica si, al presionar ENTRAR en un control TextBox multilínea, se crea una nueva línea de texto en el control o se activa el botón predeterminado del formulario.Gets or sets a value indicating whether pressing ENTER in a multiline TextBox control creates a new line of text in the control or activates the default button for the form.

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

Valor de propiedad

true si la tecla ENTRAR crea una nueva línea de texto en una versión multilínea del control; false si la tecla ENTRAR activa el botón predeterminado del formulario.true if the ENTER key creates a new line of text in a multiline version of the control; false if the ENTER key activates the default button for the form. De manera predeterminada, es false.The default is false.

Ejemplos

En el ejemplo de código siguiente se muestra la sintaxis ToolStripTextBox para establecer diversos valores de propiedades AcceptsReturn comunes, incluida la propiedad.The following code example demonstrates the syntax for setting various ToolStripTextBox common property settings, including the AcceptsReturn property .

// 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

Comentarios

Si el valor de esta propiedad es false, el usuario debe presionar Ctrl + Entrar para crear una nueva línea en un control ToolStripTextBox multilínea.If the value of this property is false, the user must press CTRL+ENTER to create a new line in a multiline ToolStripTextBox control. Si no hay ningún botón predeterminado para el formulario, la tecla entrar creará siempre una nueva línea de texto en el control, independientemente del valor de esta propiedad.If there is no default button for the form, then the ENTER key will always create a new line of text in the control, no matter what the value of this property.

Se aplica a