I saw this question but the link in the answer is no longer valid.
I also found this which I tried and doesn't work and this.
My task should be simple. I have several pages on a CMFCPropertySheet
and I want to take advantage of the new dynamic resizing features in the IDE. So I set the resizing of the controls and alas, when shown in a sheet there is no ability to resize the sheet/pages.
Trying the above resources has failed.
The header for CMyPropertySheet
:
The source for CMyPropertySheet
:
To test I just created a dialog application and added a page and assigned it to this sheet.
I just want to support dynamic resizing with property sheets / pages. What am I missing and is any of this code actually needed any more?
For modeless property sheet:
See this SO link Resizing a modeless property sheet
For modal property sheet:
How to implement a resizable property sheet
https://www.codeproject.com/Tips/214744/How-to-implement-a-resizable-property-sheet-class
Add
WS_THICKFRAME
style to the property sheet window.ps, the original article is a little old. This uses
m_psh
to access property sheet's parameters.For resizing:
Here is an alternative answer that I have come up with. It occured to me that there is no reason at all that we don't use the new dynamic layout features. It is just that the dynamic layout pointer is
NULL
to begin with.If you add the following private method to your derived property sheet class:
And call it from
OnInitDialog
then you do not need anyOnSize
event handler and no manual drawing of any kind.Just in case you are good with a CPropertySheet instead of CMFCPropertySheet, consider using ResizableLib. It includes a class
CResizableSheet
that implements a resizable version of CPropertySheet.