SelectedItem$

Windows management function.

The SelectedItem$ function returns the item selected in the specified listbox or combobox. Not available in WinTask Lite.

Usage

Allows to test what the user has selected in a listbox or combobox. Only standard Windows list/combo will work with SelectedItem$. With a non-standard list/combo, you can use Clipboard :
SendKeys("<Ctrl c">) to copy the text to Clipboard, and GetClipboard$ function to retrieve the content of Clipboard.

Syntax

var$=SelectedItem$(<window_name>)

Parameters

<window_name>, string, window name of the listbox or combobox from which the function retrieves the user selection.

Return value

var$, string, return value which contains the value selected by the user. If the list/combo does not exist, an empty string is returned.

Example

 

var$=SelectedItem$("EXPLORER.EXE|ComboBox|Run|1")