ToolStripTextBox.AutoCompleteCustomSource Propiedad

Definición

Obtiene o establece una colección de cadenas personalizada que utilizar cuando la propiedad AutoCompleteSource está establecida en 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 de propiedad

Atributos

Ejemplos

En el ejemplo de código siguiente se muestra la sintaxis ToolStripTextBox para establecer diversos valores de propiedades AutoCompleteCustomSource comunes, incluida la propiedad.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

Comentarios

Use las AutoCompleteCustomSourcepropiedades AutoCompleteMode, y AutoCompleteSource para crear un ToolStripTextBox que complete automáticamente las cadenas de entrada comparando el prefijo que se escribe con los prefijos de todas las cadenas en un origen mantenido.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. Esto resulta útil para ToolStripTextBox los controles en los que se escriben con frecuencia direcciones URL, direcciones, nombres de archivo o comandos.This is useful for ToolStripTextBox controls in which URLs, addresses, file names, or commands will be frequently entered.

El uso de la AutoCompleteCustomSource propiedad es opcional, pero debe establecer la AutoCompleteSource propiedad en para CustomSource poder usar AutoCompleteCustomSource.The use of the AutoCompleteCustomSource property is optional, but you must set the AutoCompleteSource property to CustomSource in order to use AutoCompleteCustomSource.

Debe utilizar las AutoCompleteMode propiedades y AutoCompleteSource conjuntamente.You must use the AutoCompleteMode and AutoCompleteSource properties together.

Se aplica a

Consulte también: