-
July 17th, 2014, 02:35 PM
#1
[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.
-
July 17th, 2014, 03:13 PM
#2
Re: Property Sheets on the main dialog
Did you try Create instead of DoModal?
Victor Nijegorodov
-
July 17th, 2014, 03:33 PM
#3
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.
-
July 18th, 2014, 12:48 AM
#4
Re: Property Sheets on the main dialog
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.
Best regards,
Igor
-
July 17th, 2014, 11:35 PM
#5
Re: Property Sheets on the main dialog
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();
-
July 18th, 2014, 03:26 PM
#6
Re: Property Sheets on the main dialog
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|