Bearbeiten

Freigeben über


ListView.CheckedListViewItemCollection.Item[] Property

Definition

Gets an item within the collection.

Overloads

Item[String]

Gets an item with the specified key within the collection.

Item[Int32]

Gets the item at the specified index within the collection.

Item[String]

Gets an item with the specified key within the collection.

public:
 virtual property System::Windows::Forms::ListViewItem ^ default[System::String ^] { System::Windows::Forms::ListViewItem ^ get(System::String ^ key); };
public virtual System.Windows.Forms.ListViewItem this[string key] { get; }
member this.Item(string) : System.Windows.Forms.ListViewItem
Default Public Overridable ReadOnly Property Item(key As String) As ListViewItem

Parameters

key
String

The key of the item in the collection to retrieve.

Property Value

A ListViewItem representing the item with the specified index within the collection.

Exceptions

The owner ListView is in virtual mode.

Remarks

Item[] returns null if the key parameter is null or empty.

The Name property corresponds to the key for an item in the ListView.CheckedListViewItemCollection.

Applies to

Item[Int32]

Gets the item at the specified index within the collection.

public:
 property System::Windows::Forms::ListViewItem ^ default[int] { System::Windows::Forms::ListViewItem ^ get(int index); };
public System.Windows.Forms.ListViewItem this[int index] { get; }
member this.Item(int) : System.Windows.Forms.ListViewItem
Default Public ReadOnly Property Item(index As Integer) As ListViewItem

Parameters

index
Int32

The index of the item in the collection to retrieve.

Property Value

A ListViewItem representing the item located at the specified index within the collection.

Exceptions

The index parameter is less than 0 or greater than or equal to the value of the Count property of ListView.CheckedListViewItemCollection.

The ListView is in virtual mode.

Remarks

This indexer enables you to get a specific item from the ListView.CheckedListViewItemCollection. The item stored in this collection is an item in the ListView.ListViewItemCollection of the ListView that represents a checked item in the ListView.

Applies to