Problem by using Property Page as a Dialog
-
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
-
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
-
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 usepPropSheet->DoModal();
, and here the dialog tabs are handled "normally". ~RaGE();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
-
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
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();
-
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
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 ]
-
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
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