ToolStripTextBox.AutoCompleteSource ToolStripTextBox.AutoCompleteSource ToolStripTextBox.AutoCompleteSource ToolStripTextBox.AutoCompleteSource Property

Definición

Obtiene o establece un valor que especifica el origen de cadenas completas utilizadas para la finalización automática.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 de propiedad

Uno de los valores de AutoCompleteSource.One of the AutoCompleteSource values. De manera predeterminada, es None.The default is None.

Ejemplos

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

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: