Click to See Complete Forum and Search --> : Tab-order in modeless/modal diaogs......


April 20th, 1999, 12:14 PM
Hi,
I'm having a problem with the tab-order of controls in a modeless dialog 'pasted' on to a modal dialog. The solution is already available in the 'Dialog' section of
CodeGuru and it says use DS_CONTROL style. I'm working on a 16-bit application and 16-bit doesn't have DS_CONTROL dialog style. Can anybody help with a 16-bit version of this solution...????

Thanx
Ram

Paul McKenzie
April 20th, 1999, 01:20 PM
It's not easy. If you're using MFC, you would probably need to override PreTranslateMessage() for the dialog and check for the tab key. Also SetFocus() and GetFocus() may need to be implemented.

Something that may help is that here is a virtually undocumented 16-bit CPropertyPage and CPropertySheet in the MFC source code for Visual C++ 1.52. You can check the source to see how they implemented their tab order logic.

Another thing is that tab order is dictated by the z-order of the child-windows. You can change tab-order at runtime by calling SetWindowPos().

Regards,

Paul McKenzie

Hans Straub
June 10th, 1999, 02:22 AM
I had the same problem, and both the PreTranslateMessage() hint and the source code of CPropertySheet turned out useful! I managed to code a workaround for MSVC 1.52; I posted it as a comment to the entry in the 'Dialog' section.