WS_TABSTOP

Programming, for all ages and all languages.
Post Reply
Guest

WS_TABSTOP

Post by Guest »

Hi,

Can anyone tell me how to implement tabbing between child controls in windows.

I have been searching goggle and others but cannot find anything other than being told to include it as a style to use it, but I am and it does not work.

thanks.
Tim

Re:WS_TABSTOP

Post by Tim »

Easy way: design a dialog box with your controls inside, and replace your RegisterClass+CreateWindow+message loop with a single call to DialogBox.

Hard way: have your window emulate a dialog box. The main part of this is calling IsDialogMessage inside your message loop:

Code: Select all

while (GetMessage(&msg, NULL, 0, 0))
    if (!IsDialogMessage(your_hwnd, &msg))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
Although your window will now handle most tab/keyboard functionality, there are a few more subtle points which stops it from being idential to a dialog box.
Post Reply