Selecting a Button

Windows CE provides three ways for a user to select a button: By touching it with a stylus, by tabbing to it and then pressing the ENTER key, or by tabbing to the selected button in the group and using the arrow keys to move within that group. This last method is only available if the button is part of a group defined by the WS_GROUP style. In addition to these predefined methods, you can create a keyboard accelerator to a button. A keyboard accelerator, also known as a shortcut key, is a keystroke or combination of keystrokes that generates a WM_COMMAND message. For more information about keyboard accelerators, see Dialog Boxes, Menus, and Other Resources.

Selecting a button generally causes the following events:

  1. Windows gives the button the keyboard focus.
  2. The button sends its parent window a message to notify it of the selection.
  3. The parent window or Windows CE sends the button a message to change its state.
  4. The parent window or Windows CE repaints the button to reflect its new state.