ListView.ListViewItemCollection.Item[Int32] ListView.ListViewItemCollection.Item[Int32] ListView.ListViewItemCollection.Item[Int32] ListView.ListViewItemCollection.Item[Int32] Property

定义

重载

Item[String] Item[String] Item[String] Item[String]

检索具有指定键的项。Retrieves the item with the specified key.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置集合中指定索引处的项。Gets or sets the item at the specified index within the collection.

Item[String] Item[String] Item[String] Item[String]

检索具有指定键的项。Retrieves the item with the specified key.

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

参数

key
String String String String

要检索的项的名称。The name of the item to retrieve.

属性值

ListViewItem,其 Name 属性与指定键匹配。The ListViewItem whose Name property matches the specified key.

注解

密钥比较不区分大小写。The key comparison is not case-sensitive. 属性对应于中ListViewItem ListView.ListViewItemCollection的的键。 NameThe Name property corresponds to the key for a ListViewItem in the ListView.ListViewItemCollection.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置集合中指定索引处的项。Gets or sets the item at the specified index within the collection.

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

参数

index
Int32 Int32 Int32 Int32

集合中要获取或设置的项的索引。The index of the item in the collection to get or set.

属性值

ListViewItem,表示位于集合内指定索引处的项。A ListViewItem representing the item located at the specified index within the collection.

异常

index 参数小于零或大于等于 CountListView.ListViewItemCollection 属性的值。The index parameter is less than 0 or greater than or equal to the value of the Count property of the ListView.ListViewItemCollection.

注解

您可以使用此方法来获取存储ListViewItem在集合中的特定位置的。You can use this method to obtain the ListViewItem stored at a specific location in the collection. 若要确定集合中特定项的索引,请使用IndexOf方法。To determine the index of a specific item in the collection, use the IndexOf method.

另请参阅

适用于