PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Tip: How to refresh the content of an auto-filled combo box whose source is a query?
  • Initialization code of a programmed Combo Box control
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
Combo Box control linked to a data file
Overview
A List Box or Combo Box control can be used to display the content of a data file, to allow a user to select a record for example.
When a Combo Box control is linked to a data file, the control can be initialized with the content of the data file:
  • automatically: No specific code is required to initialize the control. The characteristics of the browse performed in the file linked to the control are described in the "Content" tab of the control description.
  • by programming: The code used to browse the data file linked to the Combo Box control must be entered in the initialization code of the control. This method is not recommended.
Note: When creating a Combo Box control, the wizard asks for the relevant information required to create a Combo Box control linked to a data file.
Tip: How to refresh the content of an auto-filled combo box whose source is a query?
If you are using a Combo Box control based on a query with automatic initialization, to refresh the control content, type the following code (in the initialization code of the control for example). This code performs the following operations:
  1. Rerun the base query of the Combo box control (specifying the query parameters if needed) with HExecuteQuery.
  2. Re-display the Combo box control using ListDisplay.
// -- Initialization code of a Combo Box control
HExecuteQuery(MyQRY, hQueryDefault, Param1, Param2)
ListDisplay(COMBO_ComboName, taStart)
Initialization code of a programmed Combo Box control
If you are using a Combo Box control based on a data file with programmed initialization, the code for browsing the data file must be entered in the initializing code of the control.
For example: Initialization of a Combo Box control with the customers of the CUSTOMER file.
// -- Initialization code of a Combo Box control
HReadFirst(CUSTOMER, CustName)
WHILE NOT HOut()
ListAdd(COMBO_Combo1, Customer.CustName)
HReadNext(CUSTOMER, CustName)
END
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment