Skip to main content
Version: 3.5

ControlCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents a collection of Control objects.

public class ControlCollection : ControlCollection, IList<Control>, ICollection<Control>, IEnumerable<Control>, IWisejSynchronized

Constructors

Instance memberControlCollection(owner)

Initializes a new instance of the ControlCollection class.

NameTypeDescription
ownerControlThe Control that owns this collection.

Properties

Instance memberIsDisposed

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

Instance memberItem(index)

Control: Returns the Control at the specified indexed location.

Instance memberItem(key)

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

Instance memberOwner

Control: Returns the control that owns this ControlCollection.

Methods

Instance memberAdd(child)

Adds the specified control to the control collection.

ParameterTypeDescription
childControlThe Control to add.

Instance memberAddRange(controls)

Adds an array of control objects to the collection.

ParameterTypeDescription
controlsControl[]An array of Control objects to add to the collection.

Instance memberClear()

Removes all controls from the collection.

Instance memberClear(dispose)

Removes and disposes all controls from the collection.

ParameterTypeDescription
disposeBooleanIndicates whether the controls removed from the collection should be disposed.

Instance memberContains(control)

Determines whether the specified control is a member of the collection.

ParameterTypeDescription
controlControlThe Control to locate in the collection.

Returns: Boolean. true if the Control is a member of the collection; otherwise, false.

Instance memberContainsKey(key)

Determines whether the ControlCollection contains an item with the specified key.

ParameterTypeDescription
keyStringThe key to locate in the ControlCollection.

Returns: Boolean. true if the ControlCollection contains an item with the specified key; otherwise, false.

Instance memberFind(type, searchAllChildren)

Searches for controls by their type and builds an array of all the controls that match.

ParameterTypeDescription
typeTypeThe type of the controls to locate in the ControlCollection.
searchAllChildrenBooleantrue to search all child controls; otherwise, false.

Returns: Control[]. Array of controls that are derived from the specified type .

Throws:

Instance memberFind(key, searchAllChildren)

Searches for controls by their name and builds an array of all the controls that match.

ParameterTypeDescription
keyStringThe key to located in the ControlCollection.
searchAllChildrenBooleantrue to search all child controls; otherwise, false.

Returns: Control[]. Array of controls with the specified name.

Throws:

Instance memberGetChildIndex(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.

ParameterTypeDescription
childControlThe Control to search for in the control collection.
throwExceptionBooleantrue 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:

Instance memberGetEnumerator()

Retrieves a reference to an enumerator object that is used to iterate over a ControlCollection.

Returns: IEnumerator. An IEnumerator.

Instance memberIndexOf(control)

Retrieves the index of the specified control in the control collection.

ParameterTypeDescription
controlControlThe Control to locate in the collection.

Returns: Int32. A zero-based index value that represents the position of the specified Control in the ControlCollection.

Instance memberIndexOfKey(key)

Retrieves the index of the first occurrence of the specified item within the collection.

ParameterTypeDescription
keyStringThe 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.

Instance memberRemove(child)

Removes the specified control from the control collection.

ParameterTypeDescription
childControlThe Control to remove.

Instance memberRemoveByKey(key)

Removes the child control with the specified key.

ParameterTypeDescription
keyStringThe name of the child control to remove.

Instance memberSetChildIndex(child, newIndex)

Sets the index of the specified child control in the collection.

ParameterTypeDescription
childControlThe child control to search for.
newIndexInt32The new index value of the control.

Inherited By

NameDescription
TableLayoutControlCollectionRepresents a collection of child controls in a table layout container.