PMGuide - Combination Box: Difference between revisions
Created page with "{{IBM-Reprint}} {{PMGuide}} A combination box is two controls in one: an entry field and a list box. This chapter describes how to use combination-box controls, also called c..." |
mNo edit summary |
||
Line 2: | Line 2: | ||
{{PMGuide}} | {{PMGuide}} | ||
A combination box is two controls in one: an entry field and a list box. This chapter describes how to use combination-box controls, also called combination boxes and prompted entry fields, to let the user choose and edit items from a list in PM applications. | A combination box is two controls in one: an entry field and a list box. This chapter describes how to use combination-box controls, also called combination boxes and prompted entry fields, to let the user choose and edit items from a list in PM applications. | ||
==About Combination-Box Controls== | ==About Combination-Box Controls== | ||
Combination-box controls enable the user to enter data by typing in the entry field or by choosing from a list in the list box. A combination-box control automatically manages the interaction between the entry field and the list box. For example, when the user chooses an item in the list box, the combination-box control displays the text for that item in the entry field. Then, the user can edit the text without affecting the item in the list box. When the user types a letter in the entry field, the combination-box control scrolls the list box contents so that items beginning with that letter become visible. | Combination-box controls enable the user to enter data by typing in the entry field or by choosing from a list in the list box. A combination-box control automatically manages the interaction between the entry field and the list box. For example, when the user chooses an item in the list box, the combination-box control displays the text for that item in the entry field. Then, the user can edit the text without affecting the item in the list box. When the user types a letter in the entry field, the combination-box control scrolls the list box contents so that items beginning with that letter become visible. | ||
===Combination-Box Styles=== | ===Combination-Box Styles=== | ||
The following table shows the combination-box styles: | The following table shows the combination-box styles: | ||
{|class="wikitable" | |||
!Style Name||Description | |||
|- | |||
|CBS_SIMPLE||Creates a simple combination box that always displays its list box. The user can enter and edit text in the entry field or choose items from the list box. | |||
|- | |||
|CBS_DROPDOWN||Creates a drop-down combination box that displays its list box only if the user clicks the drop-down icon at the right end of the entry field. The combination-box control hides the list box when the user clicks the icon a second time. In a drop-down combination box, the user can enter and edit text in the entry field or choose items from the list box. | |||
|- | |||
|CBS_DROPDOWNLIST||Creates a drop-down-list combination box that is similar to the drop-down combination box, except that the user can choose items only from the list box. The user cannot enter or edit text in the entry field. | |||
|} | |||
For combination boxes that have the CBS_DROPDOWN or CBS_DROPDOWNLIST styles, an application can display the list by using the CBM_SHOWLIST message. | For combination boxes that have the CBS_DROPDOWN or CBS_DROPDOWNLIST styles, an application can display the list by using the CBM_SHOWLIST message. | ||
An application can determine whether the list is already showing by using the CBM_ISLISTSHOWING message. | An application can determine whether the list is already showing by using the CBM_ISLISTSHOWING message. | ||
Applications also can use any of the entry-field (EM_) and list-box (LM_) messages with combination boxes. Entry-field messages affect the entry field; list-box messages affect the list box. For example, an application can use the LM_INSERTITEM message to insert items into the list box. | Applications also can use any of the entry-field (EM_) and list-box (LM_) messages with combination boxes. Entry-field messages affect the entry field; list-box messages affect the list box. For example, an application can use the LM_INSERTITEM message to insert items into the list box. | ||
===Combination-Box Notification Codes === | ===Combination-Box Notification Codes === | ||
A combination-box control sends WM_CONTROL messages containing notification codes to its parent window. These notification codes are similar to those sent by entry-field and list-box controls. A combination-box control sends a notification codes to its owner window. | A combination-box control sends WM_CONTROL messages containing notification codes to its parent window. These notification codes are similar to those sent by entry-field and list-box controls. A combination-box control sends a notification codes to its owner window. |
Latest revision as of 13:54, 3 April 2025
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
A combination box is two controls in one: an entry field and a list box. This chapter describes how to use combination-box controls, also called combination boxes and prompted entry fields, to let the user choose and edit items from a list in PM applications.
About Combination-Box Controls
Combination-box controls enable the user to enter data by typing in the entry field or by choosing from a list in the list box. A combination-box control automatically manages the interaction between the entry field and the list box. For example, when the user chooses an item in the list box, the combination-box control displays the text for that item in the entry field. Then, the user can edit the text without affecting the item in the list box. When the user types a letter in the entry field, the combination-box control scrolls the list box contents so that items beginning with that letter become visible.
Combination-Box Styles
The following table shows the combination-box styles:
Style Name | Description |
---|---|
CBS_SIMPLE | Creates a simple combination box that always displays its list box. The user can enter and edit text in the entry field or choose items from the list box. |
CBS_DROPDOWN | Creates a drop-down combination box that displays its list box only if the user clicks the drop-down icon at the right end of the entry field. The combination-box control hides the list box when the user clicks the icon a second time. In a drop-down combination box, the user can enter and edit text in the entry field or choose items from the list box. |
CBS_DROPDOWNLIST | Creates a drop-down-list combination box that is similar to the drop-down combination box, except that the user can choose items only from the list box. The user cannot enter or edit text in the entry field. |
For combination boxes that have the CBS_DROPDOWN or CBS_DROPDOWNLIST styles, an application can display the list by using the CBM_SHOWLIST message.
An application can determine whether the list is already showing by using the CBM_ISLISTSHOWING message.
Applications also can use any of the entry-field (EM_) and list-box (LM_) messages with combination boxes. Entry-field messages affect the entry field; list-box messages affect the list box. For example, an application can use the LM_INSERTITEM message to insert items into the list box.
Combination-Box Notification Codes
A combination-box control sends WM_CONTROL messages containing notification codes to its parent window. These notification codes are similar to those sent by entry-field and list-box controls. A combination-box control sends a notification codes to its owner window.
Using Combination-Box Controls
You can create a combination box by using WinCreateWindow or by specifying a COMBOBOX statement in a dialog-window template in a resource file. When creating a combination box using WinCreateWindow, you must specify the predefined class WC_COMBOBOX. If you do not specify a style, the function uses the default styles WS_GROUP, WS_TABSTOP, and WS_VISIBLE.