ToolStripTextBox.AcceptsReturn Propriedade

Definição

Obtém ou define um valor que indica se pressionar ENTER em um controle TextBox multilinha cria uma nova linha de texto no controle ou ativa o botão padrão para o formulário.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 da propriedade

true se a tecla ENTER criar uma nova linha de texto em uma versão multilinha do controle; false se a tecla ENTER ativar o botão padrão para o formulário.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. O padrão é false.The default is false.

Exemplos

O exemplo de código a seguir demonstra a sintaxe para ToolStripTextBox definir várias configurações de propriedade comuns AcceptsReturn , incluindo a propriedade.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

Comentários

Se o valor dessa propriedade for false, o usuário deverá pressionar Ctrl + Enter para criar uma nova linha em um controle de várias linhas. ToolStripTextBoxIf the value of this property is false, the user must press CTRL+ENTER to create a new line in a multiline ToolStripTextBox control. Se não houver nenhum botão padrão para o formulário, a tecla ENTER sempre criará uma nova linha de texto no controle, independentemente do valor dessa propriedade.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.

Aplica-se a