Dynamically resizing CMFCPropertySheet using PropSheetLook_OneNoteTabs style

I am trying to dynamically resize CMFCPropertySheet to add a custom control at the bottom of each page. Since all property pages are not the same height, I have a mechanism to increase the size if needed. To do this, I have overridden the OnActivatePage method and using SetWindowPos I can resize the sheet first, then the tab control, then the page, and finally I can move the OK / Cancel / Help buttons. It works fine with PropSheetLook_OutlookBar and PropSheetLook_Tabs styles, but not PropSheetLook_OneNoteTabs style. The page (or tab) is incorrectly changed (the light gray color of the page does not fill the sheet.

OneNote Style OneNote http://www.freeimagehosting.net/uploads/th.ec91600664.jpg

Outlook Outlook Style http://www.freeimagehosting.net/uploads/th.319b6938ab.jpg

Any idea? Feature Feature MFC error?

+1


source to share


2 answers


I found the problem. One needs to get a link to the various tab controls that the version is using OneNote

through GetTab()

and resize it accordingly.



0


source


Just follow the instructions given in here . Although the instructions are for CPropertySheet , they work for CMFCPropertySheet .

Some parts of the code are outdated, so you need to make the following changes.



  • Complete your XmnPropSheetCallback and DoModal implementation .
  • In, OnInitDialog

    simply make a call CPropertySheet::OnInitDialog();

    and then call OnSize

    instead of doing everything in this code.
0


source







All Articles