PC SOFT

WINDEV的在线文档

  • Overview
  • Tip: How do I refresh the content of an auto-filled combo box whose source is a query?
  • Initialization code of a programmed Combo Box control
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

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 do I 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's content, enter 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 H执行查询.
  2. Re-display the Combo box control using 列表显示.
// -- Initialization code of a Combo Box control
H执行查询MyQRYh查询.默认Param1Param2
列表显示COMBO_ComboName表格.开始

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
H读第一个CUSTOMERCustName
只要不H超出()
列表添加COMBO_Combo1Customer.CustName
H读下一个CUSTOMERCustName
结束