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

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

ListViewItem.IndentCount プロパティ

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

ListViewItem のインデント幅として使用する小さイメージの幅の数を取得または設定します

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

Dim instance As ListViewItem
Dim value As Integer

value = instance.IndentCount

instance.IndentCount = value
public int IndentCount { get;
 set; }
public:
property int IndentCount {
    int get ();
    void set (int value);
}
/** @property */
public int get_IndentCount ()

/** @property */
public void set_IndentCount (int
 value)
public function get IndentCount
 () : int

public function set IndentCount
 (value : int)

プロパティ
ListViewItemインデント幅として使用する小さイメージの幅の数。

例外例外
例外種類条件

ArgumentOutOfRangeException

IndentCount設定する場合に、指定された数が 0 未満です。

解説解説

IndentCount プロパティ使用できるのは、項目を格納する ListView の View プロパティDetails設定されており、ListView の SmallImageList プロパティ設定されている場合のみです。

使用例使用例

IndentCount プロパティ設定する方法次のコード例示します。この例を実行するには、次のコードWindows フォーム貼り付けフォームコンストラクタまたは Loadイベント処理メソッドから InitializeIndentedListViewItems呼び出します。

Private indentedListView As ListView


Private Sub InitializeIndentedListViewItems()
 
    indentedListView = New ListView()
    indentedListView.Width = 200
    
    ' View must be set to Details to use IndentCount.
    indentedListView.View = View.Details
    indentedListView.Columns.Add("Indented Items",
 150)
    
    ' Create an image list and add an image.
    Dim list As New ImageList()
    list.Images.Add(New Bitmap(GetType(Button),
 "Button.bmp"))
    
    ' SmallImageList must be set when using IndentCount.
    indentedListView.SmallImageList = list
    
    Dim item1 As New ListViewItem("Click",
 0)
    item1.IndentCount = 1
    Dim item2 As New ListViewItem("OK",
 0)
    item2.IndentCount = 2
    Dim item3 As New ListViewItem("Cancel",
 0)
    item3.IndentCount = 3
    indentedListView.Items.AddRange(New ListViewItem() {item1,
 item2, item3})
    
    ' Add the controls to the form.
    Me.Controls.Add(indentedListView)

End Sub 'InitializeIndentedListViewItems
 
ListView indentedListView;

private void InitializeIndentedListViewItems()
{
    indentedListView = new ListView();
    indentedListView.Width = 200;

    // View must be set to Details to use IndentCount.
    indentedListView.View = View.Details;
    indentedListView.Columns.Add("Indented Items", 150);
   
    // Create an image list and add an image.
    ImageList list = new ImageList();
    list.Images.Add(new Bitmap(typeof(Button), "Button.bmp"));

    // SmallImageList must be set when using IndentCount.
    indentedListView.SmallImageList = list;

    ListViewItem item1 = new ListViewItem("Click", 0);
    item1.IndentCount = 1;
    ListViewItem item2 = new ListViewItem("OK", 0);
    item2.IndentCount = 2;
    ListViewItem item3 = new ListViewItem("Cancel",
 0);
    item3.IndentCount = 3;
    indentedListView.Items.AddRange(new ListViewItem[] { item1,
 item2, item3 });

    // Add the controls to the form.
    this.Controls.Add(indentedListView);

}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS