OWLNext 7.0
Borland's Object Windows Library for the modern age
|
The member functions for modifying and querying list boxes let you set values or find out the status of the control at any given time.
To know what a user is doing to a list box at run time, however, you have to respond to notification messages from the control.
There are only a few things a user can do with a list box: scroll through the list, click an item, and double-click an item. When the user does one of these things, Windows sends a list box notification message to the list box's parent window. Normally, you define notification-response member functions in the parent window object to handle notifications for each of the parent's controls.
The following table summarizes the most common list box notifications:
List box notification messages
Event response table macro | Description |
EV_LBN_SELCHANGE | An item has been selected with a single mouse click. |
EV_LBN_DBLCLK | An item has been selected with a double mouse click. |
EV_LBN_SELCANCEL | The user has deselected an item. |
EV_LBN_SETFOCUS | The user has given the list box the focus by clicking or double-clicking an item, or by using Tab. Precedes LBN_SELCHANGE notification. |
EV_LBN_KILLFOCUS | The user has removed the focus from the list box by clicking another control or pressing Tab. |
Here is a sample parent window object member function to handle an LBN_SELCHANGE notification: