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. Problem by using Property Page as a Dialog

Problem by using Property Page as a Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
6 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.
  • P Offline
    P Offline
    praveenpnayak
    wrote on last edited by
    #1

    Hi, I am trying to use a property page as a dialog. When I bring up the property page using DoModal funtion, the controls in the property page do not get tabbed. TAB does not move the focus to the next control. Ex: CPropertyPage* pPage = new CPropertyPage(IDD_DIALOG1); pPage->DoModal(); If I use the same resource as a dialog, it works fine. I am able to tab to the next control in the dialog. Ex: CDialog* pDlg = new CDialog(IDD_DIALOG2); pDlg->DoModal(); Has anyone seen this behaviour before? Could I use property page as a dialog? Please let me know if you have any solutions for this. Thanks :-). Praveen

    R R P 3 Replies Last reply
    0
    • P praveenpnayak

      Hi, I am trying to use a property page as a dialog. When I bring up the property page using DoModal funtion, the controls in the property page do not get tabbed. TAB does not move the focus to the next control. Ex: CPropertyPage* pPage = new CPropertyPage(IDD_DIALOG1); pPage->DoModal(); If I use the same resource as a dialog, it works fine. I am able to tab to the next control in the dialog. Ex: CDialog* pDlg = new CDialog(IDD_DIALOG2); pDlg->DoModal(); Has anyone seen this behaviour before? Could I use property page as a dialog? Please let me know if you have any solutions for this. Thanks :-). Praveen

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Why do you want to use a Property Page like that :confused: ? Create your property page, create one propertysheet, and Add() the propertypage to the property sheet. Then use pPropSheet->DoModal();, and here the dialog tabs are handled "normally". ~RaGE();

      P 1 Reply Last reply
      0
      • R Rage

        Why do you want to use a Property Page like that :confused: ? Create your property page, create one propertysheet, and Add() the propertypage to the property sheet. Then use pPropSheet->DoModal();, and here the dialog tabs are handled "normally". ~RaGE();

        P Offline
        P Offline
        praveenpnayak
        wrote on last edited by
        #3

        I just wanted to reuse my code. I have the property page which I am adding it to the propertysheet in my app. I have commandline options for my app which will display only the property page as a dialog. Please let me know if you have any solution for this. Thanks :-). Praveen

        R 1 Reply Last reply
        0
        • P praveenpnayak

          I just wanted to reuse my code. I have the property page which I am adding it to the propertysheet in my app. I have commandline options for my app which will display only the property page as a dialog. Please let me know if you have any solution for this. Thanks :-). Praveen

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          I am not sure about that, but I actually think that this is because of the Wizard Mode ability of Propertypages. Generally, the tabs in PropertyPages are handled by their PropertySheet, and not by the Pages themselves. This allows the tabs in wizard mode to be set only on the back, next and finish buttons. Maybe you can try to mess with the m_psp member of the propertypage, maybe there actually is a way to set the tabs feature back, but I doubt it ... ~RaGE();

          1 Reply Last reply
          0
          • P praveenpnayak

            Hi, I am trying to use a property page as a dialog. When I bring up the property page using DoModal funtion, the controls in the property page do not get tabbed. TAB does not move the focus to the next control. Ex: CPropertyPage* pPage = new CPropertyPage(IDD_DIALOG1); pPage->DoModal(); If I use the same resource as a dialog, it works fine. I am able to tab to the next control in the dialog. Ex: CDialog* pDlg = new CDialog(IDD_DIALOG2); pDlg->DoModal(); Has anyone seen this behaviour before? Could I use property page as a dialog? Please let me know if you have any solutions for this. Thanks :-). Praveen

            R Offline
            R Offline
            Renjith Ramachandran
            wrote on last edited by
            #5

            You must insert the Properthpage in propertysheet Derive a Class from CPropertySheet says CMyProSheet oSheet; Derive a Class from CPropertypage says CMyProPage oPage1; in CMyProSheet Constructor, You just add the AddPage(&oPage1) Then oSheet.DoModal();


            [ It is possible to represent everything in this universe by using 0 and 1 ]

            1 Reply Last reply
            0
            • P praveenpnayak

              Hi, I am trying to use a property page as a dialog. When I bring up the property page using DoModal funtion, the controls in the property page do not get tabbed. TAB does not move the focus to the next control. Ex: CPropertyPage* pPage = new CPropertyPage(IDD_DIALOG1); pPage->DoModal(); If I use the same resource as a dialog, it works fine. I am able to tab to the next control in the dialog. Ex: CDialog* pDlg = new CDialog(IDD_DIALOG2); pDlg->DoModal(); Has anyone seen this behaviour before? Could I use property page as a dialog? Please let me know if you have any solutions for this. Thanks :-). Praveen

              P Offline
              P Offline
              praveenpnayak
              wrote on last edited by
              #6

              Thanks guyz for helping. I have found a the solutions. The below code would solve my problem. BOOL MyPropPage::PreTranslateMessage(MSG* pMsg) { if( pMsg && (pMsg->message == WM_KEYDOWN)) { if (pMsg->wParam == VK_TAB) { CWnd* pNextControl = GetNextDlgTabItem(GetFocus(), (GetKeyState( VK_SHIFT ) & 0x8000)); if (pNextControl) GotoDlgCtrl(pNextControl);//pNextControl->SetFocus(); } } return CPropertyPage::PreTranslateMessage(pMsg); } Praveen

              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