ToolStripComboBox.AutoCompleteCustomSource Właściwość

Definicja

Pobiera lub ustawia niestandardową kolekcję ciągów do użycia, gdy właściwość jest ustawiona AutoCompleteSource na 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; }
[<System.ComponentModel.Browsable(true)>]
member this.AutoCompleteCustomSource : System.Windows.Forms.AutoCompleteStringCollection with get, set
Public Property AutoCompleteCustomSource As AutoCompleteStringCollection

Wartość właściwości

AutoCompleteStringCollection

Element AutoCompleteStringCollection zawierający ciągi.

Atrybuty

Przykłady

Poniższy przykład kodu przedstawia składnię ustawiania różnych ToolStripComboBox właściwości, w tym AutoCompleteCustomSource właściwości.

// 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

Uwagi

AutoCompleteCustomSourceUżyj właściwości , AutoCompleteModei AutoCompleteSource , aby utworzyćToolStripComboBox, który automatycznie kończy ciągi wejściowe, porównując prefiks wprowadzany do prefiksów wszystkich ciągów w utrzymywanym źródle. Jest to przydatne w przypadku ToolStripComboBox kontrolek, w których często będą wprowadzane adresy URL, adresy, nazwy plików lub polecenia.

Użycie AutoCompleteCustomSource właściwości jest opcjonalne, ale należy ustawić AutoCompleteSource właściwość na CustomSource , aby użyć AutoCompleteCustomSourcepolecenia .

Musisz użyć AutoCompleteMode właściwości i AutoCompleteSource razem.

Dotyczy

Zobacz też