How to Program Scrolling Controls for Dialog Boxes

4/19/2010

To create a scrollable modal dialog box, you specify the WS_VSCROLL style. A user scrolls the dialog box by pressing the Up and Down controls.

For modeless dialog boxes, the developer may add special code to handle navigation. Use IsDialogMessage() to handle keyboard and scrollbar messages.

The dialog box controls should be listed in the dialog box resource template in the order in which they appear on the screen, and their sizes should be as accurate as possible.

If any of the controls are repositioned after the Windows Embedded CE WM_INITDIALOG message, the dialog box needs to send a DM_RESETSCROLL message.

Remarks

On Windows Mobile Standard, the special auto-scrollbar behavior works on tabstop controls. If the UP/DOWN navigation keys move to a control, the automatically controlled scrollbar will follow. This means for example, to be able to scroll down to a static control it must be marked TABSTOP = true. An exception is if the dialog has only a single TABSTOP, then the entire dialog will scroll regardless of the tabstop setting of any controls off the current screen.

See Also

Other Resources

Designing Full-Screen Dialog Boxes