The GetListControl method returns an object of the ListControl class that is assigned to the list view with the specified ID. The ListControl class (see ListControl Class) provides methods to query and manipulate list views.


The arguments are:


The ID of the list view.


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

Return value:

An object of the ListControl class or .Nil if the requested list view does not exist.


The following example initializes list view 101 by sending message ADD to object lc, which is assigned to 101 by using GetListControl:

::class MyDlgClass subclass UserDialog inherit AdvancedControls

::method InitDialog
  lc = self~GetListControl(101)
  if lc == .Nil then return
  lc~~Add(101222)~~Add(,"Smith")~~Add(, ,"John")
  lc~~Add(101223)~~Add(,"Michael")~~Add(, ,"Carl")

Note: GetListControl 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).