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

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

ListBox.MultiColumn プロパティ

ListBox複数列をサポートするかどうかを示す値を取得または設定します

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

Dim instance As ListBox
Dim value As Boolean

value = instance.MultiColumn

instance.MultiColumn = value
public bool MultiColumn { get;
 set; }
public:
property bool MultiColumn {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_MultiColumn ()

/** @property */
public void set_MultiColumn (boolean value)

プロパティ
ListBox複数列をサポートしている場合trueそれ以外場合false既定値false です。

例外例外
例外種類条件

ArgumentException

複数列の ListBox の高さは可変にできません。

解説解説

複数列の ListBox では、必要に応じた列数に項目が配置されるため、垂直方向のスクロール不要になりますユーザーは、現在表示されていない列に移動する場合キーボード使用できますスクロール バー表示してListBox 内の表示領域に現在表示されていない列にスクロールできるようにするには、HorizontalScrollbar プロパティtrue設定します。ColumnWidth プロパティの値によって各列の幅が決まります

使用例使用例

ColumnWidth プロパティMultiColumn プロパティ使用して複数の列に項目を表示する ListBox コントロール作成する方法次のコード例示します。この例では、listBox1 という名前の ListBox コントロールフォーム追加されている必要があります

Private Sub SetupMyMultiColumn()
   Dim x As Integer
   ' Add items to the ListBox.
   For x = 0 To 50
      ListBox1.Items.Add("Items " + x.ToString())
   Next x
   ' Display items in columns.
   ListBox1.MultiColumn = True
   ' Determine the width of the items in the list to get the best column
 width setting.
   Dim width As Integer
 = CInt(ListBox1.CreateGraphics().MeasureString(ListBox1.Items(ListBox1.Items.Count
 - 1).ToString(), _
      ListBox1.Font).Width)
   ' Set the column width based on the width of each item in the list.
   ListBox1.ColumnWidth = width
End Sub
private void SetupMyMultiColumn()
{
   // Add items to the ListBox.
   for (int x = 0; x < 50; x++)
   {
      listBox1.Items.Add("Items " + x.ToString());
   }
   // Display items in columns.
   listBox1.MultiColumn = true;
   // Determine the width of the items in the list to get the best column
 width setting.
   int width = (int) listBox1.CreateGraphics().MeasureString(listBox1.Items[listBox1.Items.Count
 -1].ToString(),
      listBox1.Font).Width;
   // Set the column width based on the width of each item in the list.
   listBox1.ColumnWidth = width;
}
private:
   void SetupMyMultiColumn()
   {
      // Add items to the ListBox.
      for ( int x = 0; x < 50; x++ )
      {
         listBox1->Items->Add( String::Format( "Items {0}", x ) );

      }
      listBox1->MultiColumn = true;

      // Determine the width of the items in the list to get the best column
 width setting.
      int width = (int)listBox1->CreateGraphics()->MeasureString(
 listBox1->Items[ listBox1->Items->Count - 1 ]->ToString(), listBox1->Font
 ).Width;

      // Set the column width based on the width of each item in the
 list.
      listBox1->ColumnWidth = width;
   }
private void SetupMyMultiColumn()
{
    // Add items to the ListBox.
    for (int x = 0; x < 50; x++) {
        listBox1.get_Items().Add("Items " + System.Convert.ToString(x));
    }

    // Display items in columns.
    listBox1.set_MultiColumn(true);

    // Determine the width of the items in the list to get the best
 column
    // width setting.
    int width = (int)(listBox1.CreateGraphics().MeasureString(listBox1.
        get_Items().get_Item((listBox1.get_Items().get_Count() - 1)).
        ToString(), listBox1.get_Font()).get_Width());

    // Set the column width based on the width of each item in the list.
    listBox1.set_ColumnWidth(width);
} //SetupMyMultiColumn
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からListBox.MultiColumn プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からListBox.MultiColumn プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からListBox.MultiColumn プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS