Links

Control.ControlCollection

Wisej.Web.Control ControlCollection
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.1.0.0)
Represents a collection of Control objects.
C#
VB.NET
public class ControlCollection : ControlCollection, IList<Control>, ICollection<Control>, IEnumerable<Control>, IWisejSynchronized
Public Class ControlCollection
Inherits ControlCollection
Implements IList(Of Control), ICollection(Of Control), IEnumerable(Of Control), IWisejSynchronized

Constructors

ControlCollection(owner)

Initializes a new instance of the ControlCollection class.
Name
Type
Description
owner
Control
The Control that owns this collection.

Properties

IsDisposed

Boolean: Returns whether the owner control has already been disposed.

Item(index)

Control: Returns the Control at the specified indexed location.

Item(key)

Control: Returns the Control with the specified key in the collection.

Owner

Control: Returns the control that owns this ControlCollection.

Methods

Add(child)

Adds the specified control to the control collection.
Parameter
Type
Description
child
Control
The Control to add.

AddRange(controls)

Adds an array of control objects to the collection.
Parameter
Type
Description
controls
Control[]
An array of Control objects to add to the collection.

Clear()

Removes all controls from the collection.

Clear(dispose)

Removes and disposes all controls from the collection.
Parameter
Type
Description
dispose
Boolean
Indicates whether the controls removed from the collection should be disposed.

Contains(control)

Determines whether the specified control is a member of the collection.
Parameter
Type
Description
control
Control
The Control to locate in the collection.
Returns: Boolean. true if the Control is a member of the collection; otherwise, false.

ContainsKey(key)

Determines whether the ControlCollection contains an item with the specified key.
Parameter
Type
Description
key
String
The key to locate in the ControlCollection.
Returns: Boolean. true if the ControlCollection contains an item with the specified key; otherwise, false.

Find(type, searchAllChildren)

Searches for controls by their type and builds an array of all the controls that match.
Parameter
Type
Description
type
Type
The type of the controls to locate in the ControlCollection.
searchAllChildren
Boolean
true to search all child controls; otherwise, false.
Returns: Control[]. Array of controls that are derived from the specified type .
Throws:

Find(key, searchAllChildren)

Searches for controls by their name and builds an array of all the controls that match.
Parameter
Type
Description
key
String
The key to located in the ControlCollection.
searchAllChildren
Boolean
true to search all child controls; otherwise, false.
Returns: Control[]. Array of controls with the specified name.
Throws:

GetChildIndex(child, throwException)

Retrieves the index of the specified child control within the control collection, and optionally raises an exception if the specified control is not within the control collection.
Parameter
Type
Description
child
Control
The Control to search for in the control collection.
throwException
Boolean
true to throw an exception if the Control specified in the child parameter is not a control in the ControlCollection; otherwise, false.
Returns: Int32. A zero-based index value that represents the location of the specified child control within the control collection; otherwise -1 if the specified Control is not found in the ControlCollection.
Throws:

GetEnumerator()

Retrieves a reference to an enumerator object that is used to iterate over a ControlCollection.
Returns: IEnumerator. An IEnumerator.

IndexOf(control)

Retrieves the index of the specified control in the control collection.
Parameter
Type
Description
control
Control
The Control to locate in the collection.
Returns: Int32. A zero-based index value that represents the position of the specified Control in the ControlCollection.

IndexOfKey(key)

Retrieves the index of the first occurrence of the specified item within the collection.
Parameter
Type
Description
key
String
The name of the control to search for.
Returns: Int32. The zero-based index of the first occurrence of the control with the specified name in the collection.

Remove(child)

Removes the specified control from the control collection.
Parameter
Type
Description
child
Control
The Control to remove.

RemoveByKey(key)

Removes the child control with the specified key.
Parameter
Type
Description
key
String
The name of the child control to remove.

SetChildIndex(child, newIndex)

Sets the index of the specified child control in the collection.
Parameter
Type
Description
child
Control
The child control to search for.
newIndex
Int32
The new index value of the control.

Inherited By

Name
Description
Represents a collection of child controls in a table layout container.