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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Setting Dialog Tab Order With Propertysheet

Setting Dialog Tab Order With Propertysheet

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • J Offline
    J Offline
    John Clump
    wrote on last edited by
    #1

    I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!

    M G 2 Replies Last reply
    0
    • J John Clump

      I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!

      M Offline
      M Offline
      Martyn Pearson
      wrote on last edited by
      #2

      Check out CWnd::SetWindowPos() - I think that might do the trick!

      J 1 Reply Last reply
      0
      • M Martyn Pearson

        Check out CWnd::SetWindowPos() - I think that might do the trick!

        J Offline
        J Offline
        John Clump
        wrote on last edited by
        #3

        I looked up SetWindowPos in MSDN, and tried a few things, but none of them affected the tab order from the dialog controls to the propertysheet, and the propertysheet is last in the tab order. Here is the code I use to create the propertysheet dynamically, IDC_PPS_MAIN is a dialog resource, m_ppsMain is a CPropertysheet object. This code is ran in a dialog in its OnInitDialog() function: m_ppsMain.Create(this, WS_CHILD | WS_VISIBLE, 0); m_ppsMain.ModifyStyleEx(0, WS_EX_CONTROLPARENT); m_ppsMain.ModifyStyle(0, WS_TABSTOP); CRect rcSheet; GetDlgItem(IDC_PPS_MAIN)->GetWindowRect(&rcSheet); ScreenToClient(&rcSheet); m_ppsMain.SetWindowPos(NULL, rcSheet.left- 7, rcSheet.top - 7, 0, 0, SWP_NOZORDER | SWP_NOSIZE); // set all pages active once to avoid assertions m_ppsMain.SetActivePage(1); m_ppsMain.SetActivePage(2); m_ppsMain.SetActivePage(3); m_ppsMain.SetActivePage(4); m_ppsMain.SetActivePage(0);

        1 Reply Last reply
        0
        • J John Clump

          I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          Make sure that the property sheet/pages have the 'control' style set. This style (DS_CONTROL) tells Windows to include them in the tab order of their parent window.


          Software Zen: delete this;

          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