通过


Control.ControlCollection.Item[] 属性

定义

指示集合中的值 Control

重载

名称 说明
Item[Int32]

指示 Control 集合中指定索引位置处。

Item[String]

指示集合中具有指定键的键 Control

Item[Int32]

Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs

指示 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 控件集合中的指定索引位置。

例外

该值 index 小于零或大于或等于集合中的控件数。

注解

若要从中Control.ControlCollection检索,Control请使用特定索引值引用集合对象。 索引值为 Control.ControlCollection 从零开始的索引。

另请参阅

适用于

Item[String]

Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs
Source:
Control.ControlCollection.cs

指示集合中具有指定键的键 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.ControlCollection

注解

a NameControl 的属性对应于中项 ControlControl.ControlCollection键。

适用于