Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problems setting tab order in dialogs

Problems setting tab order in dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Barry True
    wrote on last edited by
    #1

    I have three DLLs that display dialog boxes. The classes that display the dialog boxes for two of them are derived from CDialog and the third one is an ATL dialog. For sake of argument, we'll call the two CDialog classes CDialog1 and CDialog2 and the ATL dialog ATL3. The CDialog1 dialog has over 60 objects on it, a mix of combo boxes, edit boxes, radio buttons, and command buttons. CDialog2 has a much smaller number of objects on it but they are all standard controls. The same is true for ATL3. I've got the tab order set in all three dialogs so that pressing the tab key should allow the user to traverse the dialog in top-to-bottom, left-to-right order. However, when I run the application that loads these three DLLs the tab order for CDialog1 appears to be exactly opposite to what the tab order was defined. When the CDialog2 and ATL3 dialogs are displayed the tab key does nothing on either one of them. All three have one of the command buttons set as the default button. My questions are: 1) Why does CDialog1's tab order at run-time appear to be exactly backward from it's defined tab order? 2) Why does setting the tab order for CDialog2 and ATL3 not appear to be working? 3) Does setting a default button on the dialog have an affect on the tab order?

    D 1 Reply Last reply
    0
    • B Barry True

      I have three DLLs that display dialog boxes. The classes that display the dialog boxes for two of them are derived from CDialog and the third one is an ATL dialog. For sake of argument, we'll call the two CDialog classes CDialog1 and CDialog2 and the ATL dialog ATL3. The CDialog1 dialog has over 60 objects on it, a mix of combo boxes, edit boxes, radio buttons, and command buttons. CDialog2 has a much smaller number of objects on it but they are all standard controls. The same is true for ATL3. I've got the tab order set in all three dialogs so that pressing the tab key should allow the user to traverse the dialog in top-to-bottom, left-to-right order. However, when I run the application that loads these three DLLs the tab order for CDialog1 appears to be exactly opposite to what the tab order was defined. When the CDialog2 and ATL3 dialogs are displayed the tab key does nothing on either one of them. All three have one of the command buttons set as the default button. My questions are: 1) Why does CDialog1's tab order at run-time appear to be exactly backward from it's defined tab order? 2) Why does setting the tab order for CDialog2 and ATL3 not appear to be working? 3) Does setting a default button on the dialog have an affect on the tab order?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Do the dialogs have the WS_EX_CONTROLPARENT style?


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      B 2 Replies Last reply
      0
      • D David Crow

        Do the dialogs have the WS_EX_CONTROLPARENT style?


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        B Offline
        B Offline
        Barry True
        wrote on last edited by
        #3

        No. None of the dialogs are configured with this extended style. -- modified at 15:52 Tuesday 10th April, 2007

        1 Reply Last reply
        0
        • D David Crow

          Do the dialogs have the WS_EX_CONTROLPARENT style?


          "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

          "Judge not by the eye but by the heart." - Native American Proverb

          B Offline
          B Offline
          Barry True
          wrote on last edited by
          #4

          Actually I found out what was causing my problems with the CDialog classes. The app we are using is trapping the keystrokes. Some other of our DLLs were using a hook into the app to get the keystrokes passed down to our DLL code. Once I added this hook code into the CDialog2 DLL (see original posting) the tab keys worked. The reason I didn't stumble on this earlier is that we have so many DLLs as part of the project we are working on and the people that originally designed the other DLLs are no longer with the project (typical). I now just have to find out how to do this in the ATL3 DLL code. I've got another template that works in our code so I'll just take a look at that. Thanks for your help.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups