Clear Method

Applies To

ComboBox control, Controls collection, DataObject object, ListBox control, Pages collection, Tabs collection.

Description

Removes all objects from an object or collection.

Syntax

object.Clear

The Clear method syntax has these parts:

Part

Description

object

Required. A valid object.


Remarks

For a MultiPage or TabStrip, the Clear method deletes individual pages or tabs.

For a ListBox or ComboBox, Clear removes all entries in the list.

For a Controls collection, Clear deletes controls that were created at run time with the Add method. Using Clear on controls created at design time causes an error.

If the control is bound to data, the Clear method fails.

See Also

Add method, Remove method.

Example

See the Add method example.