PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

This page concerns the 23 + version of WINDEV, WEBDEV, WINDEV Mobile. Upgrade your version.
  • Overview
  • Initializing and filling a Combo Box control
  • Initializing an element
  • Initializing the edit control (editable combo box)
  • Filling a Combo Box control
  • Selecting an element in a Combo Box control
  • Selecting an element in a Combo Box control
  • Selecting the last element of a Combo Box control
  • Retrieving the element selected in the Combo Box control
  • Retrieving the subscript of selected element
  • Retrieving the value of selected element
  • Finding an element in a Combo Box control with table
  • Properties specific to the management of Combo Box controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Combo Box control by programming. To do so, use the variable of the Combo Box control in the code. This variable is a numeric variable.
The variable of Combo Box control:
  • corresponds to the name of Combo Box control.
  • is initialized with the subscript of the element selected in the control.
To handle an element of Combo Box control, use the following notation:

<Name of Combo Box>[<Element Subscript>]
Note: Several WLanguage functions are specific to the management of Combo Box controls. For more details, see: the functions for managing list boxes and combo boxes and functions specific to the management of Combo Box controls.
Initializing and filling a Combo Box control

Initializing an element

To initialize an element found in a Combo Box control (editable or not), use <List box>.Add.
To modify an element found in a Combo Box control (editable or not), use the direct assignment:
<Name of Combo Box>[Subscript] = <Value>
Android In Android, a negative value or a null value cannot be assigned to a Combo Box control. An element must necessarily be selected if the Combo Box control is not empty. An error will occur if a negative value or a null value is assigned to a Combo Box control.
WINDEVWindows MobileJava

Initializing the edit control (editable combo box)

To initialize the control of an editable combo box, use:
  • the direct assignment:
    <Name of Combo Box> = <Value>
  • <List box>.Add.
    // Add elements into a list
    COMBO_COMBO1.Add("MOORE")
    COMBO_COMBO1.Add(Cust_Name)

Filling a Combo Box control

To initialize a Combo Box control, all you have to do is use an iteration loop to initialize all control elements.
Subscript is int
FOR Subscript = <Start Position> TO <End Position>
<Name of Combo Box>.Add(<Value>)
END
Example:
i is int
FOR i = 1 to 52
COMBO_COMBO.Add(NAME[i])
END
Selecting an element in a Combo Box control

Selecting an element in a Combo Box control

To select the element found at <Subscript> row, use:
  • the direct assignment:
    <Name of Combo Box> = Subscript
  • <List box>.SelectPlus:
    <Name of Combo Box>.SelectPlus(<Subscript>)
WINDEVWindows MobileJava Note: For an editable combo box, only the second syntax is allowed.

Selecting the last element of a Combo Box control

To position on the last element of Combo Box control, use:
WINDEVWindows MobileJava Note: For an editable combo box, only the last syntax is allowed.
Retrieving the element selected in the Combo Box control

Retrieving the subscript of selected element

To retrieve the subscript of selected element, use:
  • the direct reading of element:
    Subscript = <Name of Combo Box>
  • <List box>.Select:
    Subscript = <Name of Combo Box>.ListeSelect()
WINDEVWindows MobileJava Note: These two syntaxes can be used in the editable or non-editable Combo Box controls. In an editable Combo Box control, if the element was modified in the edit control, <List box>.Select returns the content of edit control.

Retrieving the value of selected element

To retrieve the value of selected element, use one of the following syntaxes:
  • Syntax 1 (non-editable combo box)
    subscript is int = <Name of Combo Box>
    <Variable> = <Name of Combo Box>[Subscript]
  • Syntax 2 (non-editable combo box)
    <Variable> = <Name of Combo Box>[<Name of Combo Box>]
  • Syntax 3: ..DisplayedValue (editable or non-editable combo box)
    WEBDEV - Server code Server code only
    <Variable> = <Name of Combo Box>..DisplayedValue
  • WINDEVWindows MobileJava Special syntax (editable combo box)
    <Variable> = <Name of Combo Box>
Finding an element in a Combo Box control with table
WINDEVWindows MobileJava To find an element in a Combo Box control with table, use TableSeek.
Reminder: To perform a search in a "standard" Combo Box control, use <List box>.Seek.
Properties specific to the management of Combo Box controls
The following properties are used to manage the Combo Box controls:
Any type of combo box
HorizontalAlignmentUsed to find out and modify the horizontal alignment of the elements found in the Combo Box control.
Versions 17 and later
Ellipse
New in version 17
Ellipse
Ellipse
Allows you to find out and modify the management mode of ellipsis.
LineHeightAllows you to find out and modify the height of rows in a Combo Box control.
MemoryAllows you to find out whether the specified control is a memory or browsing Combo Box control.
OccurrenceAllows you to find out the number of rows in a Combo Box control.
FillTypeAllows you to find out how a Combo Box control is filled (file, memory, variable).
EmptyAllows you to find out whether a Combo Box control is empty.
Editable combo box only
Versions 17 and later
WithInput
New in version 17
WithInput
WithInput
Allows you to find out and modify the input mode of Combo Box control (editable or not).
CursorAllows you to find out and modify the position of mouse cursor in a control.
CursorEndAllows you to find out and modify the end position of mouse cursor.
Versions 17 and later
MemoryFormat
New in version 17
MemoryFormat
MemoryFormat
Allows you to find out and modify the format of returned value.
Versions 17 and later
DisplayMask
New in version 17
DisplayMask
DisplayMask
Allows you to find out and modify the display mask.
InputMaskAllows you to find out and modify the input mask.
SizeAllows you to find out and modify the maximum number of characters contained in the edit control of combo box.
SelectedTextAllows you to find out and modify the text selected in the edit control of combo box.
Versions 17 and later
InputType
New in version 17
InputType
InputType
Allows you to find out and modify the type of data typed in the edit control of combo box.
Non-editable combo box only
Versions 23 and later
SearchAAF
New in version 23
SearchAAF
SearchAAF
Used to:
  • find out whether the search is enabled on a non-editable Combo Box control,
  • enable (or not) the search via AAF on a non-editable Combo Box control.
Memory combo box only
InitialContentAllows you to find out the initial content of a memory Combo Box control.
SortedAllows you to find out whether a memory Combo Box control is sorted and to sort a memory Combo Box control.
Browsing combo box only
BrowsedFileAllows you to find out and modify the file or query used to display the records in the browsing Combo Box controls.
AutoBrowseAllows you to find out whether the browse performed in a browsing Combo Box control is an automatic browse or a programmed browse.
DisplayedItemAllows you to find out and modify the item displayed in a Combo Box control.
StoredItemAllows you to find out and modify the stored item of a Combo Box control.
BrowsedItemAllows you to find out and modify the item used for the automatic browse of Combo Box controls.

To find out the entire list of WLanguage properties that can be used with a Combo Box control, see Properties associated with the Combo Box control.
Minimum required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment