Methods                                                                     Object

ObjectName.Method [arglist]

Description

Object methods are procedures in objects. The required component, ObjectName, is a valid object expression that refers to an object added to a program with an ADDOBJECT statement. The required component, Method, is the name of a FUNCTION or SUB procedure in an object, see below for a list of common object methods. The optional component, arglist, is a comma-separated list of values that are passed to the procedure as arguments. Calling a method in an object can change how an object is displayed, how it interacts, and the values of its properties.

Table 14: Object Methods

Method

Arguments

Comments

AddItem

text[, index]

Adds text to the list of items, with an optional index. If no index is supplied, text is put at the end of unsorted lists, or text is inserted to proper place in sorted lists. ComboBox, ListBox

Clear

 

Clears all items from list. ComboBox, ListBox

Hide

 

Hide object and set Visible property to FALSE.

Move

x, y, w, h

Moves object to new x, y location, with optional resizing if w and h are provided.

RemoveItem

index

Remove an item from list by index (0 = first item). ComboBox, ListBox

SetFocus

 

Activate object to receive keyboard input.

Show

 

Show object and set Visible property to TRUE.

 

Example

REM Object Methods Example

'Methods are procedures in objects

ADDOBJECT "ComboBox", "Combo", 5, 5, 150,110

Combo.AddItem("Eric")

Combo.AddItem("Kenny")

Combo.AddItem("Kyle")

Combo.AddItem("Stan")

Combo.ListIndex = 0

Combo.SetFocus

Output

Related Items

Events, Properties