Control.ControlCollection.Item[] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates a Control in the collection.
Overloads
Item[Int32] |
Indicates the Control at the specified indexed location in the collection. |
Item[String] |
Indicates a Control with the specified key in the collection. |
Item[Int32]
Indicates the Control at the specified indexed location in the collection.
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
Parameters
- index
- Int32
The index of the control to retrieve from the control collection.
Property Value
The Control located at the specified index location within the control collection.
Exceptions
The index
value is less than zero or is greater than or equal to the number of controls in the collection.
Remarks
To retrieve a Control from the Control.ControlCollection, reference the collection object with a specific index value. The index value of the Control.ControlCollection is a zero-based index.
See also
Applies to
Item[String]
Indicates a Control with the specified key in the collection.
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
Parameters
- key
- String
The name of the control to retrieve from the control collection.
Property Value
The Control with the specified key within the Control.ControlCollection.
Remarks
The Name property of a Control corresponds to the key for a Control in the Control.ControlCollection.