ToolStripTextBox.AutoCompleteSource Propriedade

Definição

Obtém ou define um valor que especifica a origem de cadeias de caracteres completas usadas para o preenchimento automático.Gets or sets a value specifying the source of complete strings used for automatic completion.

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

Valor da propriedade

Um dos valores de AutoCompleteSource.One of the AutoCompleteSource 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 AutoCompleteSource , incluindo a propriedade.The following code example demonstrates the syntax for setting various ToolStripTextBox common property settings, including the AutoCompleteSource 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