Keyboard functionality in tabbed dialogs

Posted on 1998-08-13
Last Modified: 2013-12-03
I am using TabControl to create a dialog with several tabs. Currently, all my tabs are defined with separate dialog templates and shown/hidden when tabs are changed.

If I use DialogBox(), keyboard functionality does not work. My current solution is to use CreateDialog() and code all the keyboard functionality myself. However, this is quite a task, so I'd like to know if there is an easier way.

Property sheets are out of question. Using CreateDialog() and having IsDialogMessage() in the message loop doesn't work, because IsDialogMessage() apparently doesn't support child dialogs. And I don't want to create a "flat" dialog with all controls in the top-level template, because individual tabs are complex and I want to have separate WndProc()'s for them.
Question by:mikkon
  • 3
  • 2

Expert Comment

ID: 1413428
Could you please specify what exactly does not work? Is it Tab key? Shortcuts? Switching tabs by keyboard?

Expert Comment

ID: 1413429
Could you please specify what exactly does not work? Is it Tab key? Shortcuts? Switching tabs by keyboard?

Author Comment

ID: 1413430
Tab key, arrow keys, shortcuts, etc. standard dialog functionality. The tab order must go between the parent dialog and its child (the one on the tab control). For example, if I press tab on the last control in the child dialog, focus must move to the parent dialog (the OK button, in this case).

Currently I am not interested in switching tabs by keyboard.


Accepted Solution

Arkadiy earned 100 total points
ID: 1413431
The first thing to do is to specify DS_CONTROL style in the template of the child dialog. Here is the documentation:

                             Creates a dialog box that works well as a
                             child window of another dialog box,
                             much like a page in a property sheet.
                             This style allows the user to tab among
                             the control windows of a child dialog
                             box, use its accelerator keys, and so on.

If that flag does not help, reject the answer and we will start over :)

Author Comment

ID: 1413432
Excellent! This did exactly what I wanted with minimum work. Thanks very much!


Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now