The GetScrollBar method returns an object of the ScrollBar class that is assigned to the scroll bar with the specified ID. The ScrollBar class (see ScrollBar Class) provides methods to query and manipulate scroll bars.


The arguments are:


The ID of the scroll bar.


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

Return value:

An object of the ScrollBar class or .Nil if the requested scroll bar does not exist.


The following example sets a new range and a new position for scroll bar HORSB. Object "di" is connected to scroll bar HORSB.

::class MyDlgClass subclass UserDialog inherit AdvancedControls

::method FocusPage
  di = self~GetScrollBar("HORSB")
  if di == .Nil then return 0
  di~setRange(0, 1000, 0)
  di~setPos(500, 1)

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