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


The arguments are:


The ID of the combo box.


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

Return value:

An object of the ComboBox class or .Nil if the requested combo box does not exist.


The following example comes from a fictious accounting program. In one of the dialogs for the program, when the user selects a specific city, say San Diego, the zip code combo box is populated with the valid zip codes for that city. In the program, symbolic IDs have been used for the controls. The valid zip codes are passed into the method as an array.

::class "BillingDlg" subclass RcDialog inherit AdvancedControls MessageExtensions


::method setZipCodes
  use strict arg codes

  combo = self~getComboBox(IDC_COMBO_ZIP)
  if combo == .Nil then return .false

  lowest = 99999
  do zipCode over codes
    if zipCode < lowest then do
      lowest = zipCode
  return .true

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