PC SOFT

WINDEV的在线文档

  • Overview
  • Creating a Combo Box column
  • Characteristics of the Combo Box column
  • Programming a Combo Box column
  • Initializing the content of the Combo Box column
  • Selecting an element of the Combo Box column by programming
  • Retrieving the content of a Combo Box column
  • Combo box with or without edit
  • Note
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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 columns in the Table controls

Overview
A Table control (memory table, browsing table or table on data) can include Combo Box columns.

The Combo Box columns can be used to view in a Table control the file items of the following types: combo box, list box, radio button or check box. The combo boxes can also be used to display images in a Table control.

Reminder: To display an image in a Table control, use an image column.

See Combo Box control for more details.

Creating a Combo Box column
To create a Combo Box column, all you have to do is select "Combo Box" in the type of the column:

Characteristics of the Combo Box column
In most cases, a Combo Box column in a Table control has all the characteristics of a Combo Box control. This combo box can be linked to a data file for example.

The following characteristics are available:

  • Editable or non-editable combo box ("Details" tab of the column description).
  • Combo box with or without assisted input ("Details" tab of the column description).
  • Sorted or unsorted combo box (for the memory combo boxes only, "Details" tab of the column description).
  • Configuring the button of the combo box ("Details" tab of the column description).
  • Configuring the drop-down list: width, height, resizable list ("Details" tab of the column description).
  • Displaying (or not) the selection bar in the combo box ("Details" tab of the column description).
  • Configuring the style of the combo box ("Style" tab, "Combo Box column (button)" element).
If the combo box is not linked to an item of a data file, you have the ability to enter the initial content of the combo box.

Note: The height of a row in the combo box is identical to the height of a row in the Table control.

Programming a Combo Box column

Initializing the content of the Combo Box column

The content of the Combo Box column can be initialized:
  • in the editor, in the details of the column: in this case, it cannot be graphic.
  • by programming with 列表添加, in the initialization process of the Table control for example.
The content of the Combo Box column cannot be modified, even for an editable combo box. Therefore, the values proposed in a Combo Box column will be the same for all the rows of the Table control.

Selecting an element of the Combo Box column by programming

To select an element of the Combo Box column, all you have to do is specify the subscript of the element to display. This subscript can be used by the functions for managing the Table controls.

For example:

  • adding a row with 表格添加:
    // TABLE_CustomerTable contains:
    // - a Combo Box column that displays the title of the customers
    // (1 corresponds to "Mr", 2 to "Mrs" and 3 to "Miss")
    // - a String column that displays the name of the customers
    // Add "Mr" and "Doe" at the end of this Table control
    表格添加TABLE_CustomerTable1+TAB+"Doe"
  • modifying the 5th row with 表格修改行:
    // TABLE_CustomerTable contains:
    // - a Combo Box column that displays the title of the customers
    // (1 corresponds to "Mr", 2 to "Mrs" and 3 to "Miss")
    // - a String column that displays the name of the customers
    // Modify the 5th row with "Mrs" and "Thomas"
    表格修改行TABLE_CustomerTable52"Thomas"

Retrieving the content of a Combo Box column

The value selected in a Combo Box column can be retrieved by ..值.

Combo box with or without edit

  • Important:
    • In a non-editable combo box, the content of the combo box cannot be retrieved directly: only the subscript can be retrieved. To find out the value selected in the combo box, use ..显示值.
    • In an editable combo box, the content of the combo box can be retrieved directly.
  • The Combo Box column stores the corresponding subscript of the combo box (if an item is associated with the column, the subscript is also stored by the item). Therefore, the content of the combo box must not be modified.
  • The processes associated with a Combo Box column are identical to the processes associated with a Combo Box control.
  • The Combo Box columns in selection without input do not expand.

Note

The combo boxes in the Table controls have the same content for all the rows, only the selected value changes according to the row. However, since version 14, you have the ability to change the content of the combo box columns for each row. Do to so, use the ..内容 property of the Combo Box column.