[RESOLVED] Property Sheets on the main dialog
I have been playing around with property sheets/property pages and have been successful in getting them to work in a secondary dialog by calling the property sheet using DoModal().
I cannot figure out how to get the property sheet to display on the main dialog of a dialog application.
I am using VS2008 and CMFCPropertySheet and CMFCPropertyPage.
Re: Property Sheets on the main dialog
Did you try Create instead of DoModal?
Re: Property Sheets on the main dialog
Yes I tried this in the OnInitDialog()
Code:
// TODO: Add extra initialization here
m_dlgMainSheet.AddPage(&m_PageOne);
m_dlgMainSheet.AddPage(&m_PageTwo);
m_dlgMainSheet.Create(this, WS_CHILD | WS_VISIBLE, 0);
m_dlgMainSheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT);
m_dlgMainSheet.ModifyStyle( 0, WS_TABSTOP );
Where m_dlgMainSheet is a CMFCPropertySheet declared in the main dialog header file.
I keep getting a "A required resource is not available" message when I start the app.
Re: Property Sheets on the main dialog
Quote:
Originally Posted by
zapper222
I have been playing around with property sheets/property pages and have been successful in getting them to work in a secondary dialog by calling the property sheet using DoModal().
I cannot figure out how to get the property sheet to display on the main dialog of a dialog application.
I am using VS2008 and CMFCPropertySheet and CMFCPropertyPage.
In the InitInstance method of app class, replace the default dialog with your propertysheet and call DoModal();
Re: Property Sheets on the main dialog
Quote:
Originally Posted by
zapper222
Yes I tried this in the OnInitDialog()
Code:
// TODO: Add extra initialization here
m_dlgMainSheet.AddPage(&m_PageOne);
m_dlgMainSheet.AddPage(&m_PageTwo);
m_dlgMainSheet.Create(this, WS_CHILD | WS_VISIBLE, 0);
m_dlgMainSheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT);
m_dlgMainSheet.ModifyStyle( 0, WS_TABSTOP );
Where m_dlgMainSheet is a CMFCPropertySheet declared in the main dialog header file.
I keep getting a "A required resource is not available" message when I start the app.
You always can debug Create call and see what happens under the hood. But afraid property sheet was not designed to be a child window.
Re: Property Sheets on the main dialog
Quote:
Originally Posted by
Arjay
In the InitInstance method of app class, replace the default dialog with your propertysheet and call DoModal();
Yep that's the ticket, thanks Arjay.