Control.ControlCollection.Item[] 屬性

定義

表示集合中的 Control

多載

Item[Int32]

指示集合中指定索引位置的 Control

Item[String]

表示集合中具有指定索引鍵的 Control

Item[Int32]

指示集合中指定索引位置的 Control

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

參數

index
Int32

要從控制項集合中擷取的控制項的索引。

屬性值

Control

位於控制項集合中指定索引位置的 Control

例外狀況

index 值小於零,或者大於或等於集合中控制項的數目。

備註

若要從 擷 Control.ControlCollectionControl ,請參考具有特定索引值的集合物件。 的 Control.ControlCollection 索引值是以零起始的索引。

另請參閱

適用於

Item[String]

表示集合中具有指定索引鍵的 Control

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

參數

key
String

要從控制項集合中擷取的控制項名稱。

屬性值

Control

Control 中,具有指定索引鍵的 Control.ControlCollection

備註

NameControl 屬性會對應至 中的 索引 Control.ControlCollectionControl

適用於