ToolStripComboBox.AutoCompleteCustomSource プロパティ

定義

AutoCompleteSource プロパティが 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

プロパティ値

文字列を格納している AutoCompleteStringCollection

属性

次のコード例は、 プロパティを含むさまざまな ToolStripComboBox プロパティを設定するための構文を AutoCompleteCustomSource 示しています。

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

注釈

、、および の各プロパティをAutoCompleteCustomSourceAutoCompleteMode使用して、入力されるプレフィックスをAutoCompleteSource保守対象のソース内のすべての文字列のプレフィックスと比較することで、入力文字列を自動的に完了する を作成ToolStripComboBoxします。 これは、URL、アドレス、ファイル名、またはコマンドを頻繁に入力するコントロールに役立ちます ToolStripComboBox

プロパティのAutoCompleteCustomSource使用は省略可能ですが、 を使用AutoCompleteCustomSourceするには、 プロパティを AutoCompleteSourceCustomSource設定する必要があります。

プロパティと AutoCompleteSource プロパティを一緒にAutoCompleteMode使用する必要があります。

適用対象

こちらもご覧ください