Xbasic

UI_GET_LIST2 Function

Syntax

Result as C = ui_get_list2(C title ,C default ,C choices [,N style [,L preserve_selection_order [,L flagOwnerDraw [,C headingText [,N height [,N width ]]]]]])

Arguments

Result

The user selection.

title

The title of the dialog box.

default

The default selection.

choices

A CR-LF delimited list of choices to be shown in the dialog.

style

Optional. Default = 1.

1 = Single select
2 = Multi-select (single click on an item in the list to add it to the list of selected values),
3 = Multi-select (use standard Windows behavior to select - hold down shift or control then click on an entry to extend the selection)
preserve_selection_order

Optional. Default = .F. If this property is set to TRUE (.T.) and the style allows multiple selections, the selections are returned in the order in which the selections were made.

flagOwnerDraw

Logical

headingText

Character

height

Numeric

width

Numeric

Description

Prompts user for selection from a CR-LF delimited list of choices. Style: 1 = single select, 2 = multi-select (click item to select), 3 = multi-select (Shift+Click, Ctrl+Click and Drag are supported)

Discussion

The UI_GET_LIST2() function displays a dialog containing a list box of choices. The list of choices is not limited to 8 choices, and is passed into the function as a single argument (a CR-LF delimited list), rather than one argument per choice, as is the case with UI_GET_LIST().

Example

dim list as C
dim res as C
list = a5.Color_Enum()
res = ui_get_list2("","",list,1)
ui_msg_box("",res)
res = ui_get_list2("","",list,2)
ui_msg_box("",res)
res = ui_get_list2("","",list,3)
ui_msg_box("",res)

Returning a Multiple Values from a List

This example shows how to allow the user to select and return multiple values from a selection list produced by a function or method.

dim list as C
dim tbl_name as C = "customer"
list = ui_get_list2("Select Fields", "", table.external_field_name_get(tbl_name, "N"), 2)

Limitations

Desktop applications only.

See Also