Using tab to navigate

So I made an app, now everything works fine, except when you press the TAB key the error sound is played. That's not the problem, the problem is nothing besides that happens. You cannot navigate between buttons and/or input boxes...Do I have to implement a special VK_TAB action or what?
If you create your window as a dialog box, you get that handled automatically as I recall. I almost never code UI's in C++ so I usually am a little fuzzy in certain topics.

If you cannot move to a dialog, well, I'm not sure I can be of help. I don't recall ever reading how this part of dialog boxes works or is implemented.
the deal is, I only have one window :P means you open the program and that's the window, since I have no need for another windows.
Well you can still present it as a dialog box. Your entire WinMain() could be a call to DialogBox().
so how do you do that?
Well, just like that. Design your main window as a dialog in a resource file, then simply display it using the DialogBox() function in WinMain. That's it. No registering of a window class, no message pump. Just a single call to DialogBox().

BTW, note that you still have to write the dialog procedure.
Okay, thank you for helping.
You need to have WS_TABSTOP window style, that's all.
That's it? Nice, modoran. Did not know that. Thanks for the tip.
WS_TABSTOP for edit boxes or the whole window?

I tried all, no success...I declared a window with WS_TABSTOP while all edit boxes had it too...
Is there anything specific you have to do?

ok I googled and found! you have to add:
1
2
3
4
5
6
7
if (!IsDialogMessage(hwnd, &messages))
        {
            /* Translate virtual-key messages into character messages */
            TranslateMessage(&messages);
            /* Send message to WindowProcedure */
            DispatchMessage(&messages);
        }
Last edited on
WS_TABSTOP for edit boxes or the whole window?


For the parent (main) window.
Topic archived. No new replies allowed.