ToolStripTextBox.AutoCompleteMode Propriedade

Definição

Obtém ou define uma opção que controla como o preenchimento automático funciona para o ToolStripTextBox.Gets or sets an option that controls how automatic completion works for the ToolStripTextBox.

public:
 property System::Windows::Forms::AutoCompleteMode AutoCompleteMode { System::Windows::Forms::AutoCompleteMode get(); void set(System::Windows::Forms::AutoCompleteMode value); };
[System.ComponentModel.Browsable(true)]
public System.Windows.Forms.AutoCompleteMode AutoCompleteMode { get; set; }
member this.AutoCompleteMode : System.Windows.Forms.AutoCompleteMode with get, set
Public Property AutoCompleteMode As AutoCompleteMode

Valor da propriedade

Um dos valores de AutoCompleteMode.One of the AutoCompleteMode values. O padrão é None.The default is None.

Atributos

Exemplos

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

Use as AutoCompleteCustomSourcepropriedades AutoCompleteMode,, AutoCompleteSource e para criar uma ToolStripTextBox que conclua automaticamente as cadeias de caracteres de entrada comparando o prefixo que está sendo inserido para os prefixos de todas as cadeias de caracteres em uma origem mantida.Use the AutoCompleteCustomSource, AutoCompleteMode, and AutoCompleteSource properties to create a ToolStripTextBox that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. Isso é útil para ToolStripTextBox controles nos quais URLs, endereços, nomes de arquivo ou comandos serão inseridos com frequência.This is useful for ToolStripTextBox controls in which URLs, addresses, file names, or commands will be frequently entered.

O uso da AutoCompleteCustomSource propriedade é opcional, mas você deve definir a AutoCompleteSource Propriedade como para CustomSource usar AutoCompleteCustomSource.The use of the AutoCompleteCustomSource property is optional, but you must set the AutoCompleteSource property to CustomSource in order to use AutoCompleteCustomSource.

Você deve usar as AutoCompleteMode propriedades AutoCompleteSource e juntas.You must use the AutoCompleteMode and AutoCompleteSource properties together.

Aplica-se a

Veja também