Solved

Keyboard functionality in tabbed dialogs

Posted on 1998-08-13
5
355 Views
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.
0
Comment
Question by:mikkon
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

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

Expert Comment

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

Author Comment

by:mikkon
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.

0
 
LVL 1

Accepted Solution

by:
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:

DS_CONTROL
                             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 :)
0
 
LVL 1

Author Comment

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

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

785 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