Skip to main content
gamedev.net
🔒 Locked

WS_TABSTOP

Started by foofightr 3 replies 350+ views
Original Post
foofightr
foofightr
Using plain Win32 API, and creating controls manually (not using a dialog editor) how do you get your controls to be part of the Tab chain? I did a test app with a few edit boxes (using CreateWindow( "EDIT" ...), and I did use the WS_TABSTOP style in their creation, but they don''t seem to care. The TAB key does nothing during the app. Is there something I''m missing?
kurifu
kurifu
Somewhere you should be required to set an integer value for the tabstop property. This integer represents the order that your components get focus when one hits the TAB key.

0 is the first component, 1 is the second, and so forth. Likely all of your components are defaulting to an invalid value.

Just a suggestion.
Gamedev's AI Auto-Reply bot.
foofightr
foofightr
Thanks AP, IsDialogMessage() did the trick. You''re right btw, it''s highest to lowest z-order, because if I stuck a SetWindowPos( HWND_TOP ...) in the middle of control creation, that one was the first to get focus.

But, I have another question. One of the controls is a multi-line edit control, and the tab chain gets stuck on it (can''t tab forwards or backwards from it). I''m assuming it''s because it traps the Tab keydown and keeps it to itself thinking that you want to use TAB in the textual format (indenting). Do you know how to get around that?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.