<< Click to Display Table of Contents >> Navigation: 1. Starting Guides > 1.9.1 Types of controls > 1. Starting Guide |
Starting Guide
Dropdown and Combobox Control
What controls do we have to do with?
A Dropdown Control is like a Listbox combined with a menu.
Below is an example of a "Dropdown Control".
There are two distinct types of dropdown controls:
1. The standard Dropdown Control, which only allows selection.
2. The Combobox Control, which combines a dropdown and an edit-box control.
For convenience, we often refer to both as a Combobox Control. Regardless, both types of controls are addressed. Sometimes, the windows-inspector will clearly indicate the type of control you're dealing with.
Here's an example of a Dropdown Control:
In the image below, you'll notice an Edit Control beneath the Combobox Control.
This is a true Combobox Control because it also includes an Edit Control, as you can see in the image below:
When you want to input text into the built-in text-box, you can locate either the Combo-Box or the Edit-Control. Normally, both will function as expected. These two scripts will both perform the same action and write some text into the control:
' Locate the Combobox-Control
STW.ct|#32770|Sample Application
SCW.nc|1|ComboBox
SCW.nc|1|Edit
SDT.Hallo
' Locate the Edit-Control below the Combobox
STW.ct|#32770|Sample Application
SCW.nc|1|ComboBox
SCW.nc|1|Edit
SDT.Hallo
If you want to select an item from the Combo-Box, then you need to locate the Combo-Box.
You have two ways of doing so:
STW.ct|#32770|Sample Application
SCW.c|ComboBox
SCI.Entry Number 1
or using the SAO.-command:
STW.ct|#32770|Sample Application
SAO.rn|46|{&NOTEXT}
SCI.Entry Number 1
Troubleshooting Dropdown-Controls
In a few applications, you might encounter a problem where a Dropdown-Control displays the value that you've sent using the SCI. (direct engine command). However, the application does not react to that value, or it reacts as if the value wasn't set. In these cases, the application reads the value once the Dropdown control is opened and closed. This is done using the CDD. - command.
A single CDD.-command without any parameters will open and close the currently located Dropdown control.
Here's a complete code example:
' Here is an complete code example.
STW.ct|TSelectLanguageForm|Select Setup Language
SCW.nc|1|TNewComboBox
SCI.english
' the following line opens and closes the dropdown control
CDD.
As window classes can be named freely by the programmer of an application, the window class of dropdown controls can differ from those in the examples here.
Dropdown Controls in WEB-Browsers are not windows controls and do not react to neither SCI. or CDD. In this case, you need to use the command SAO. and MOS. or MLI. to open, select, and close the WEB-Browser based Control.
See also:
• GCT. - Get-Childs-TopWindows
• SAO. - Search Accessible Object
• MOS. - Mouseless Object Select
• MLI - Mouse Left Click quIckly (Invinsible)