PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview of the Combo Box control
  • Control in a window, control in a dynamic or static page
  • Creating a Combo Box control
  • To create a Combo Box control:
  • Type of the Combo Box control expanded area
  • Characteristics of the Combo Box control
  • Editable Combo Box: type and mask of the input area
  • Adjusting the size of the expanded area
  • Non-editable Combo Box: Search in the values of the Combo Box control
  • Size of the expanded area
  • Height of the input area in the Combo Box control
  • Drawing in Combo Box controls
  • Smartphone mode
  • Limitations in Java
  • Vocabulary
  • Swap
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 of the Combo Box control

Control in a window, control in a dynamic or static page

The "Combo Box" control is used to display a list of elements and to select an element from this list.
Unlike a List Box, a Combo Box control is not expanded: the control is expanded on a user action or when the cursor is positioned on the list.
Versions 15 and later
Android Combo Box controls are now available for Android applications.
New in version 15
Android Combo Box controls are now available for Android applications.
Android Combo Box controls are now available for Android applications.
Versions 16 and later
WINDEVLinux Combo Box controls are now available for WINDEV applications in Linux.
New in version 16
WINDEVLinux Combo Box controls are now available for WINDEV applications in Linux.
WINDEVLinux Combo Box controls are now available for WINDEV applications in Linux.
Versions 18 and later
Universal Windows 10 App Combo Box controls are now available for applications in Windows Store apps mode.
New in version 18
Universal Windows 10 App Combo Box controls are now available for applications in Windows Store apps mode.
Universal Windows 10 App Combo Box controls are now available for applications in Windows Store apps mode.
Versions 19 and later
iPhone/iPad Combo Box controls are now available for iPhone/iPad applications.
New in version 19
iPhone/iPad Combo Box controls are now available for iPhone/iPad applications.
iPhone/iPad Combo Box controls are now available for iPhone/iPad applications.
WINDEVWINDEV Mobile In WINDEV and WINDEV Mobile, you can:
  • enter a value in the edit control if the Combo Box control is editable.
  • display elements in a table-like format if the Combo Box control contains multiple columns.
  • display elements in a ListView-like format.
  • open a popup window.
  • adjust the width and height of the expanded list via the Combo Box control (see below)
Here are some examples:
Non-editable Combo Box, not expanded
Non-editable Combo Box control, not expanded
Expanded Combo Box with elements in a list-like format
Expanded Combo Box control with elements in a list-like format
WINDEVWINDEV Mobile The following examples only apply to WINDEV and WINDEV Mobile.
Expanded Combo Box with elements in a table-like format
Expanded Combo Box control with elements in a table-like format
Editable Combo Box with assisted input
Editable Combo Box control with assisted input
Graphic Combo Box
Graphic Combo Box control
Expanded Combo Box with elements in a ListView-like format
Expanded Combo Box control with elements in a ListView-like format
Combo Box that opens a popup window
Combo Box control that opens a popup window
The elements displayed in a Combo Box control can be defined when creating the control in the editor. These elements:
  • are defined by programming.
  • come from a data file or query.
Creating a Combo Box control

To create a Combo Box control:

  1. On the "Creation" pane, in the "Usual controls" group, click "Combo Box".
  2. Click the position where the control must be created in the page or window. The Combo Box control creation wizard starts automatically.
WINDEVWINDEV Mobile Tip: You can also create a "preset" Combo Box control by expanding the "Combo Box" option. The list of available controls is displayed with the project skin template. Simply click the control you want to create in the editor.
To view the control characteristics, select "Description" in the popup menu of the control.
Versions 18 and later
Universal Windows 10 App For applications in Windows Store Apps mode, it is recommended to use a native Combo Box (select "Native Combo Box" in the "Details" tab of the control description window).
New in version 18
Universal Windows 10 App For applications in Windows Store Apps mode, it is recommended to use a native Combo Box (select "Native Combo Box" in the "Details" tab of the control description window).
Universal Windows 10 App For applications in Windows Store Apps mode, it is recommended to use a native Combo Box (select "Native Combo Box" in the "Details" tab of the control description window).
WINDEVAndroidUniversal Windows 10 AppWindows MobileJava

Type of the Combo Box control expanded area

The type of Combo Box control expanded area depends on the elements displayed by the Combo Box control .
To change the type of the Combo Box control expanded area, select "Expanded type" in the "Content" tab of the Combo Box description window ("Description" in the popup menu).
The available types are as follows:
  • List Box: displays elements in a list-like format.
    For a browsing Combo Box control, the displayed item is defined in the "Content" tab of the control description window ("Description" in the popup menu).
  • Table: displays elements in a table-like format. A "Combo Box with table" is automatically created if the Combo Box control must display more than one element.
    To view the characteristics of the list columns, select "Column description" in the control popup menu (or click "Edit columns" in the "Content" tab of the Combo Box description window).
    For a browsing Combo Box control, the displayed items are defined in the characteristics of the list columns ("Column description" in the popup menu or "Edit columns" in the "Content" tab of the control description window).
    AndroidiPhone/iPadUniversal Windows 10 App This type of expanded area is not available.
    WINDEVLinux In WINDEV Linux, this type of expanded area is not available.
  • ListView: displays elements in a ListView-like format.
    To view the characteristics of the ListView, click "Edit the ListView..." in the "Content" tab of the Combo Box description window.
    For a browsing Combo Box control, the item associated with the image caption and the one associated with the image are defined via the options "Displayed item" and "Image item" in the "Content" tab of the Combo Box description ("Description" in the popup menu).
    AndroidiPhone/iPadUniversal Windows 10 App This type of expanded area is not available.
    WINDEVLinux In WINDEV Linux, this type of expanded area is not available.
  • Popup window: opens a popup window.
    The popup window can be selected in the "Content" tab of the control description window ("Description" in the popup menu).
    AndroidiPhone/iPadUniversal Windows 10 App This type of expanded area is not available.
Characteristics of the Combo Box control
WINDEVWindows MobileJava

Editable Combo Box: type and mask of the input area

In editable Combo Box controls, you can configure the edit control used:
  • Versions 17 and later
    WINDEVWindows define the type of data entered: Text, Numeric, Currency, Date, Time, Duration.
    New in version 17
    WINDEVWindows define the type of data entered: Text, Numeric, Currency, Date, Time, Duration.
    WINDEVWindows define the type of data entered: Text, Numeric, Currency, Date, Time, Duration.
  • define an input mask. This mask depends on the type of information (date, text, etc.) displayed in the Combo Box control. Several input masks are available for each type.
    These input masks are multilingual: different input masks can be selected according to the runtime language of the project.
    These input masks can be modified by programming with ..InputMask.
  • Versions 17 and later
    WINDEVWindows define a display mask. This display mask is available for editable Combo Box controls whose type is: Numeric, Currency, Date, Time or Duration.
    These display masks are multilingual: different display masks can be selected according to the runtime language of the project.
    These display masks can be modified by programming with ..DisplayMask.
    New in version 17
    WINDEVWindows define a display mask. This display mask is available for editable Combo Box controls whose type is: Numeric, Currency, Date, Time or Duration.
    These display masks are multilingual: different display masks can be selected according to the runtime language of the project.
    These display masks can be modified by programming with ..DisplayMask.
    WINDEVWindows define a display mask. This display mask is available for editable Combo Box controls whose type is: Numeric, Currency, Date, Time or Duration.
    These display masks are multilingual: different display masks can be selected according to the runtime language of the project.
    These display masks can be modified by programming with ..DisplayMask.
To use multilingual masks:
  1. Click Multilingual to select the multilingual masks.
  2. Choose the relevant mask for each language supported by window.
  3. Validate. Only the input mask of the current language used in the editor is displayed.
WINDEVWindows Mobile

Adjusting the size of the expanded area

The size of the expanded area can be:
  • automatically managed by WINDEV. In this case, it automatically adapts to the content (default).
  • defined in the editor. In this case, the size is fixed.
The size of the expanded area can be specified in the "Height" option, in the "Details" tab of the control description window. If this option is set to 0, the height of the expanded area is set automatically.
If the size of the expanded area is not automatically set, it can be adjusted in the editor:
  1. Select the Combo Box control in the window.
  2. Click the "Spin" button of the Combo Box control. The mouse cursor turns into a vertical arrow. The Combo Box expanded area is displayed as a rectangle.
  3. Resize the expanded area as needed with the black handle.
To resize the Combo Box expanded area with pixel precision:
  1. Open the description window of the Combo Box control ("Description" in the popup menu).
  2. In the "Details" tab, specify (in pixels) the size of the expanded area ("Height" and "Width").
Remarks:
  • By default, the width of the expanded area corresponds to the width of the input area in the Combo Box control.
  • By default, the height of the expanded area is optimized according to the elements displayed in the Combo Box control ("Height" set to 0 in the "Details" tab of the Combo Box description window).
  • To enable end users to resize the expanded area directly in the application (using the expanded area resizing handle), check "Resizable" in the "Details" tab of the Combo Box control description ("Description" in the popup menu).
  • To save the size of the expanded area when the end user closes the window, check "Remember size" in the "Details" tab of the Combo Box description window ("Description" in the popup menu). Thus, when the window is opened again, the expanded area will be the same size as the last time.
Versions 23 and later
WINDEV

Non-editable Combo Box: Search in the values of the Combo Box control

For non-editable Combo Box controls that list a large amount of information, you can propose a search area allowing the user to easily find the element to select.
To implement this feature:
  • from the editor: check "With search" in the "Details" tab of the non-editable Combo Box description.
  • by programming: use ..SearchAAF.
Remark: The hint text "Search" is automatically displayed in the search area of the Combo Box control. This text cannot be configured.
New in version 23
WINDEV

Non-editable Combo Box: Search in the values of the Combo Box control

For non-editable Combo Box controls that list a large amount of information, you can propose a search area allowing the user to easily find the element to select.
To implement this feature:
  • from the editor: check "With search" in the "Details" tab of the non-editable Combo Box description.
  • by programming: use ..SearchAAF.
Remark: The hint text "Search" is automatically displayed in the search area of the Combo Box control. This text cannot be configured.
WINDEV

Non-editable Combo Box: Search in the values of the Combo Box control

For non-editable Combo Box controls that list a large amount of information, you can propose a search area allowing the user to easily find the element to select.
To implement this feature:
  • from the editor: check "With search" in the "Details" tab of the non-editable Combo Box description.
  • by programming: use ..SearchAAF.
Remark: The hint text "Search" is automatically displayed in the search area of the Combo Box control. This text cannot be configured.
WEBDEV - Server code

Size of the expanded area

The size of the expanded area varies according to the browser used. If there are more elements in the Combo Box than those that can be displayed in the list, the scrolling is automatically managed: the expanded area has a vertical scrollbar.
Windows Mobile

Height of the input area in the Combo Box control

In the editor, the height of the input area corresponds to the height of the control input area at runtime.
To modify this height, change the font size in the "Style" tab of the Combo Box description window:
  • of the input area text,
  • of the selected row,
  • of the elements in the Combo Box.
WINDEVWindows Mobile

Drawing in Combo Box controls

You can draw or display an image in Combo Box controls via the drawing functions specific to the List Box and Combo Box controls.
Remark: If a row of a Combo Box control displays an image via gImage, when this row is selected, the image is re-used in the main row.
Windows Mobile

Smartphone mode

Smartphones require special attention because of their very small screens. Combo Box controls work differently on Smartphones for this reason.
See Smartphone mode for more details.
Java

Limitations in Java

The following characteristics are not supported in Java:
  • tooltip on scrollbar.
  • mandatory input.
  • custom height and width of the expanded area.
  • help number associated with the Combo Box control.
  • display mask for the input area.
  • type of input area.
Vocabulary
To easily handle a Combo Box control, you must be familiar with the following vocabulary:
Name Definition
Selection barAllows you to view the selected element in the expanded area. A specific color is used in most cases.
Browsing combo boxThe Combo box control is based on a data file or query. The control elements correspond to the file records.
Two types of browsing Combo box controls are available:
  • Browsing Combo Box control "Loaded in memory": The content of the control is loaded in memory then it is displayed in the control. Access to the elements of the Combo Box control is faster. This mode is reserved for data files with less than 100,000 records.
  • Browsing Combo Box control "Direct access (no limit)": The control displays the content of the data file or query. The current record corresponds to the selected element. Selecting an element in the control triggers an access to the linked data file. This type of control is reserved for data files with more than 100,000 records.
Memory Combo BoxThe Combo Box control is not based on a data file or query. The elements displayed in the Combo Box control are defined by the developer (in the description window or by programming).
Editable Combo BoxThe user can enter text in the edit control associated with the Combo Box. If "Assisted input" is selected, the user can easily select the element by typing the first letters: the letters typed are automatically completed with the corresponding element.
Non-editable Combo BoxThe user selects an element in the expanded area via the selection bar.
WEBDEV - Server code Remark: "Editable Combo Box" and "Non-editable Combo Box" are not available in WEBDEV.
Swap
WINDEVWindows MobileJava WINDEV allows you to automatically transform a standard Combo Box into a Combo Box with table (and vice versa):
  1. Select the control to transform.
  2. On the "Modification" pane, in the "Transformations" group, expand "Refactoring and swapping" and select "Combo Box/Combo Box with table".
Related Examples:
The Combo Box control Unit examples (WINDEV): The Combo Box control
[ + ] Using a Combo Box control
WD Managing a computer fleet Complete examples (WINDEV): WD Managing a computer fleet
[ + ] This example presents the management of a computer fleet with WINDEV.
The following topics are presented in this example:
1/ the printed reports,
2/ the graphic representation of the location of the computer,
3/ the automatically filled combo boxes.
Summary of the example supplied with WINDEV:
This example is used to manage a computer fleet.
For each computer, you will be able to define its characteristics, its components, the person who is using it as well as its location in the offices.
The EyeMagnet Unit examples (WINDEV): The EyeMagnet
[ + ] Using the "eYe magnet" mechanism (also called conditional formatting)
The "eYe magnet" consists in modifying the visual aspect of a control in order to attract the user's attention to this control. WINDEV allows you to automatically modify this visual aspect according to a set of conditions.
Minimum version required
  • Version 9
This page is also available for…
Comments
Como deixar a combo com um valor já setado?
Se a combo tiver um List é assim:

SelectListPlus(Combo_customer, ListSeek(Combo_customer, "Adriano")

Se a combo tiver uma Table é assim:

SelectTablePlus(Combo_customer, TableSeek(Combo_customer, "Adriano")

BOLLER
10 Jan. 2020
Como deixar uma combo vazia via programação
Combo_Customer = -1
BOLLER
10 Jan. 2020