Page 1 of 1

WS_TABSTOP

Posted: Thu Jul 10, 2003 7:13 am
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.

Re:WS_TABSTOP

Posted: Thu Jul 10, 2003 10:19 am
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.