GetListBox

>>-anAdvancedControl~GetListBox(--id--+-------------+--)-------><
                                      +-,--category-+


The GetListBox method returns an object of the ListBox class that is assigned to the list box with the specified ID. The ListBox class (see ListBox Class) provides methods to query and manipulate list boxes.

Arguments:

The arguments are:

id

The ID of the list box.

category

The number of the category dialog page containing the requested list box. This argument must only be specified for category dialogs.

Return value:

An object of the ListBox class or .Nil if the requested list box does not exist.

Example:

The following example removes all entries of list box AREAS and adds several new entries. Entry City will be preselected. Object "di" is connected to list box AREAS.

::class MyDlgClass subclass UserDialog inherit AdvancedControls

::method UpdateList
  di = self~GetListBox("AREAS")
  if di == .Nil then return 0
  di~DeleteAll
  di~Add("Town")
  di~Add("City")
  di~Add("Green")
  di~Add("Forest")
  di~Select("City")

Note: GetListBox connects an Object Rexx object with a Windows object. If the object does not exist, the Nil object is returned. Therefore, this method can only be applied after the Windows dialog has been created (after the invocation of StartIt).