System.Web.UI Namespace ControlCollection Class
Removes a control at the specified index in a ControlCollection.
[ VB ]
Public Sub RemoveAt ( _
ByVal index As Integer
)
[ C# ]
public void RemoveAt (
int index
);
[ C++ ]
public: void RemoveAt (
int index
);
[ JScript ]
public function RemoveAt (
index : int
);
- index
- The index number of the Control to remove.
Use this method to remove a Control object at the specified index location in the parent server control's ControlCollection object.
To remove a Control based on reference, use the Remove method.
The following example demonstrates how to use the RemoveAt method to programmatically remove a Control at the specified index location in a ControlCollection.
// get the controls collection
ControlCollection myControls = myControl.Controls;
// remove the control at the given index
myControls.RemoveAt ( 0 );
' get the controls collection
Dim myControls As ControlCollection = myControl.Controls
' remove the control at the given index
myControls.RemoveAt ( 0 ) |
|
C# |
VB |
ControlCollection Members Controls.Remove Controls.Clear Controls.Add Controls.AddAt