DataGridViewCellCollection.IList.Item[Int32] 屬性

定義

在指定的索引位置上取得或設定項目。

property System::Object ^ System::Collections::IList::Item[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };
object System.Collections.IList.Item[int index] { get; set; }
object? System.Collections.IList.Item[int index] { get; set; }
member this.System.Collections.IList.Item(int) : obj with get, set
 Property Item(index As Integer) As Object Implements IList.Item

參數

index
Int32

要取得或設定的項目索引。

屬性值

指定之索引處的 DataGridViewCell

實作

例外狀況

在設定這個屬性時所指定的值不是 DataGridViewCell

設定這個屬性時所指定的值是 null

所指定的儲存格在設定此屬性時已經屬於 DataGridView 控制項。

-或-

所指定的儲存格在設定此屬性時已經屬於 DataGridViewRow 控制項。

index 小於 0。

-或-

index 等於或大於集合中的儲存格數目。

備註

這個成員是明確介面成員實作, 只有在 DataGridViewCellCollection 執行個體轉換成 IList 介面時,才能使用這個成員。

適用於

另請參閱