DataGridViewComboBoxCell.MaxDropDownItems プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewComboBoxCell.MaxDropDownItems プロパティの意味・解説 

DataGridViewComboBoxCell.MaxDropDownItems プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ドロップダウン リスト表示される項目最大数を取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Overridable Property
 MaxDropDownItems As Integer
Dim instance As DataGridViewComboBoxCell
Dim value As Integer

value = instance.MaxDropDownItems

instance.MaxDropDownItems = value
public virtual int MaxDropDownItems { get;
 set; }
public:
virtual property int MaxDropDownItems {
    int get ();
    void set (int value);
}
/** @property */
public int get_MaxDropDownItems ()

/** @property */
public void set_MaxDropDownItems (int
 value)
public function get MaxDropDownItems
 () : int

public function set MaxDropDownItems
 (value : int)

プロパティ
表示できるドロップダウン リスト項目の数。最小値は 1、最大値100 です。既定値は 8 です。

例外例外
例外種類条件

ArgumentOutOfRangeException

このプロパティ設定時に指定した値が 1 未満であるか、100上回ってます。

解説解説

ホストされている DataGridViewComboBoxEditingControl がある場合は、MaxDropDownItems プロパティ変更すると、その対応する MaxDropDownItems プロパティ変更されます。

使用例使用例

このプロパティ類似している DataGridViewComboBoxColumn.MaxDropDownItems プロパティ使用方法次のコード例示します

Private Shared Sub SetAlternateChoicesUsingItems(
 _
    ByRef comboboxColumn As DataGridViewComboBoxColumn)

    With comboboxColumn
        .Items.AddRange(New String() _
                {"Mr.", "Ms.",
 "Mrs.", "Dr."})
    End With
End Sub

Private Function CreateComboBoxColumn() _
    As DataGridViewComboBoxColumn
    Dim column As New DataGridViewComboBoxColumn()

    With column
        .DataPropertyName = ColumnName.TitleOfCourtesy.ToString()
        .HeaderText = ColumnName.TitleOfCourtesy.ToString()
        .DropDownWidth = 160
        .Width = 90
        .MaxDropDownItems = 3
        .FlatStyle = FlatStyle.Flat
    End With
    Return column
End Function
private static void SetAlternateChoicesUsingItems(
    ref DataGridViewComboBoxColumn comboboxColumn)
{
    {
        comboboxColumn.Items.AddRange(
            new string[] { "Mr.",
 "Ms.", "Mrs.", "Dr." });
    }
}

private DataGridViewComboBoxColumn CreateComboBoxColumn()
{
    DataGridViewComboBoxColumn column =
        new DataGridViewComboBoxColumn();
    {
        column.DataPropertyName = ColumnName.TitleOfCourtesy.ToString();
        column.HeaderText = ColumnName.TitleOfCourtesy.ToString();
        column.DropDownWidth = 160;
        column.Width = 90;
        column.MaxDropDownItems = 3;
        column.FlatStyle = FlatStyle.Flat;
    }
    return column;
}
private:
    void SetAlternateChoicesUsingItems(
        DataGridViewComboBoxColumn^% comboboxColumn)
    {
        {
            comboboxColumn->Items->AddRange(
                gcnew array<String^> { "Mr.", "Ms.", "Mrs.",
 "Dr." });
        }
    }

private:
    DataGridViewComboBoxColumn^ CreateComboBoxColumn()
    {
        DataGridViewComboBoxColumn^ column =
            gcnew DataGridViewComboBoxColumn();
        {
            column->DataPropertyName = ColumnName::TitleOfCourtesy.ToString();
            column->HeaderText = ColumnName::TitleOfCourtesy.ToString();
            column->DropDownWidth = 160;
            column->Width = 90;
            column->MaxDropDownItems = 3;
            column->FlatStyle = FlatStyle::Flat;
        }
        return column;
    }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewComboBoxCell クラス
DataGridViewComboBoxCell メンバ
System.Windows.Forms 名前空間
DataGridView クラス
ComboBox.MaxDropDownItems プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataGridViewComboBoxCell.MaxDropDownItems プロパティ」の関連用語

DataGridViewComboBoxCell.MaxDropDownItems プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridViewComboBoxCell.MaxDropDownItems プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS