ToolStripTextBox.HideSelection Propriedade

Definição

Obtém ou define um valor que indica se o texto selecionado no controle de caixa de texto permanece realçado quando o controle perde o foco.Gets or sets a value indicating whether the selected text in the text box control remains highlighted when the control loses focus.

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

Valor da propriedade

true se o texto selecionado não aparecer realçado quando o controle de caixa de texto perde o foco. false se o texto selecionado permanecer realçado quando o controle de caixa de texto perde o foco.true if the selected text does not appear highlighted when the text box control loses focus; false, if the selected text remains highlighted when the text box control loses focus. O padrão é true.The default is true.

Exemplos

O exemplo de código a seguir demonstra a sintaxe para ToolStripTextBox definir várias configurações de propriedade comuns HideSelection , incluindo a propriedade.The following code example demonstrates the syntax for setting various ToolStripTextBox common property settings, including the HideSelection 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

Você pode usar essa propriedade para manter o texto realçado em um controle de caixa de texto enquanto outro formulário ou uma caixa de diálogo tem foco, como uma caixa de diálogo verificador ortográfico.You can use this property to keep text highlighted in a text box control while another form or a dialog box has focus, such as a spelling checker dialog box.

Aplica-se a