ToolStripComboBox.AutoCompleteCustomSource Property

Definition

Obtiene o establece la colección de cadenas personalizada que se utilizará cuando la propiedad AutoCompleteSource se establezca en CustomSource.Gets or sets the 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

Property Value

AutoCompleteStringCollection

Una colección AutoCompleteStringCollection que contiene las cadenas.An AutoCompleteStringCollection that contains the strings.

Attributes

Examples

En el ejemplo de código siguiente se muestra la sintaxis para establecer diversas propiedades de ToolStripComboBox, incluida la propiedad AutoCompleteCustomSource.The following code example demonstrates the syntax for setting various ToolStripComboBox properties, including the AutoCompleteCustomSource property.

// The following code example demonstrates the syntax for setting
// various ToolStripComboBox properties.
// 
toolStripComboBox1.AutoCompleteCustomSource.AddRange(new string[] {
"aaa",
"bbb",
"ccc"});
toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
toolStripComboBox1.DropDownHeight = 110;
toolStripComboBox1.DropDownWidth = 122;
toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
toolStripComboBox1.IntegralHeight = false;
toolStripComboBox1.Items.AddRange(new object[] {
"xxx",
"yyy",
"zzz"});
toolStripComboBox1.MaxDropDownItems = 9;
toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert;
toolStripComboBox1.Name = "toolStripComboBox1";
toolStripComboBox1.Size = new System.Drawing.Size(121, 25);
toolStripComboBox1.Sorted = true;
' The following code example demonstrates the syntax for setting
' various ToolStripComboBox properties.
' 
toolStripComboBox1.AutoCompleteCustomSource.AddRange(New String() {"aaa", "bbb", "ccc"})
toolStripComboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend
toolStripComboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource
toolStripComboBox1.DropDownHeight = 110
toolStripComboBox1.DropDownWidth = 122
toolStripComboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard
toolStripComboBox1.IntegralHeight = False
toolStripComboBox1.Items.AddRange(New Object() {"xxx", "yyy", "zzz"})
toolStripComboBox1.MaxDropDownItems = 9
toolStripComboBox1.MergeAction = System.Windows.Forms.MergeAction.Insert
toolStripComboBox1.Name = "toolStripComboBox1"
toolStripComboBox1.Size = New System.Drawing.Size(121, 25)
toolStripComboBox1.Sorted = True

Remarks

Use las propiedades AutoCompleteCustomSource, AutoCompleteModey AutoCompleteSource para crear un ToolStripComboBox 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 ToolStripComboBox 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 los controles de ToolStripComboBox en los que se escribirán las direcciones URL, las direcciones, los nombres de archivo o los comandos con frecuencia.This is useful for ToolStripComboBox controls in which URLs, addresses, file names, or commands will be frequently entered.

El uso de la propiedad AutoCompleteCustomSource es opcional, pero debe establecer la propiedad AutoCompleteSource en CustomSource para 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 usar las propiedades AutoCompleteMode y AutoCompleteSource juntas.You must use the AutoCompleteMode and AutoCompleteSource properties together.

Applies to

See also