Editar

Compartilhar via


ListViewItem.ListViewSubItemCollection.Item[] Property

Definition

Gets an item from the collection.

Overloads

Item[Int32]

Gets or sets the subitem at the specified index within the collection.

Item[String]

Gets an item with the specified key from the collection.

Item[Int32]

Gets or sets the subitem at the specified index within the collection.

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

Parameters

index
Int32

The index of the item in the collection to retrieve.

Property Value

A ListViewItem.ListViewSubItem representing the subitem located at the specified index within the collection.

Exceptions

The index parameter is less than zero or greater than or equal to the value of the Count property of the ListViewItem.ListViewSubItemCollection.

Remarks

You can use this method to obtain the ListViewItem.ListViewSubItem stored at a specific location in the collection. To determine the index of a specific item in the collection, use the IndexOf method.

Applies to

Item[String]

Gets an item with the specified key from the collection.

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

Parameters

key
String

The name of the ListViewItem.ListViewSubItem to retrieve.

Property Value

The ListViewItem.ListViewSubItem with the specified key.

Remarks

The Name property corresponds to the key for a ListViewItem.ListViewSubItem in the ListViewItem.ListViewSubItemCollection.

The key comparison is not case-sensitive. If the key parameter is null or an empty string, Item[] returns null.

Applies to