PowerTools CalendarGrid for Windows Forms 1.0J
AutoCompleteSource プロパティ (CalendarComboBoxCellType)
使用例 

オートコンプリートに使用される補完文字列のソースを指定する値を取得または設定します(System.Windows.Forms.ComboBox.AutoCompleteSource を参照)。
構文
Public Property AutoCompleteSource As AutoCompleteSource
public AutoCompleteSource AutoCompleteSource {get; set;}

プロパティ値

System.Windows.Forms.AutoCompleteSource 値の 1 つ。既定値は System.Windows.Forms.AutoCompleteSource.None です。

AutoCompleteMode プロパティが System.Windows.Forms.AutoCompleteMode.None でない場合、AutoCompleteSource プロパティを System.Windows.Forms.AutoCompleteSource.ListItems 以外の値に変更すると、その CalendarComboBoxCellTypeDropDownStyle は自動的に CalendarGridComboBoxStyle.DropDown に変更されます。

例外
例外解説
System.ComponentModel.InvalidEnumArgumentException指定された値が System.Windows.Forms.AutoCompleteSource 値の 1 つではありません。
解説
System.Windows.Forms.ComboBox.AutoCompleteSource の解説を参照してください。
使用例
次のサンプルコードは、ComboBox 型セルの動作または外観をカスタマイズする方法を示します。このサンプルコードは、CalendarComboBoxCellType クラスに示されている詳細なコード例の一部を抜粋したものです。
CalendarComboBoxCellType CreateAutoCompleteComboBoxCell()
{
    CalendarComboBoxCellType comboBoxCell = new CalendarComboBoxCellType();

    comboBoxCell.DropDownStyle = CalendarGridComboBoxStyle.DropDown;
    comboBoxCell.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
    comboBoxCell.AutoCompleteSource = AutoCompleteSource.CustomSource;
    string[] customSourceItems = new string[] { "aaa", "bbb", "ccc", "ddd" };
    comboBoxCell.AutoCompleteCustomSource.AddRange(customSourceItems);

    comboBoxCell.Items.Add("(none)");
    comboBoxCell.Items.Add("aaa");
    comboBoxCell.Items.Add("bbb");
    comboBoxCell.Items.Add("ccc");
    comboBoxCell.Items.Add("ddd");

    return comboBoxCell;
}
Private Function CreateAutoCompleteComboBoxCell() As CalendarComboBoxCellType
    Dim comboBoxCell As New CalendarComboBoxCellType()

    comboBoxCell.DropDownStyle = CalendarGridComboBoxStyle.DropDown
    comboBoxCell.AutoCompleteMode = AutoCompleteMode.SuggestAppend
    comboBoxCell.AutoCompleteSource = AutoCompleteSource.CustomSource
    Dim customSourceItems As String() = New String() {"aaa", "bbb", "ccc", "ddd"}
    comboBoxCell.AutoCompleteCustomSource.AddRange(customSourceItems)

    comboBoxCell.Items.Add("(none)")
    comboBoxCell.Items.Add("aaa")
    comboBoxCell.Items.Add("bbb")
    comboBoxCell.Items.Add("ccc")
    comboBoxCell.Items.Add("ddd")

    Return comboBoxCell
End Function
参照

CalendarComboBoxCellType クラス
CalendarComboBoxCellType メンバ
DataSource プロパティ
Items プロパティ
AutoCompleteCustomSource プロパティ
AutoCompleteMode プロパティ

 

 


© 2014 GrapeCity inc. All rights reserved.