ToolStripTextBox.AutoCompleteCustomSource Propriedade

Definição

Obtém ou define uma coleção de cadeias de caracteres personalizada a ser usada quando a propriedade AutoCompleteSource é definida como CustomSource.Gets or sets a custom string collection to use when the AutoCompleteSource property is set to CustomSource.

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

Valor da propriedade

Atributos

Exemplos

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