Solved

Keyboard functionality in tabbed dialogs

Posted on 1998-08-13
5
359 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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