Click here to Skip to main content
11,924,280 members (60,728 online)
Click here to Skip to main content
Add your own
alternative version


29 bookmarked

Resizable Property Sheet/Wizard using CDialogResize

, 12 Mar 2007
Rate this:
Please Sign up or sign in to vote.
Make Property Sheet/Wizards resizable without much modification.



Since I once created an re-sizable property sheet implementation in plain C, I decided also to do so in WTL. My goal during implementation was to stay as close as possible on WTL original source. This leads to an implementation which could 1 by 1 replaced by conventional source.


  1. Resizable Property Sheet window class
  2. Resizable Property Sheet Page class (see CDialogResize for more information about usage)
  3. Double buffered redraw is possible using WS_EX_COMPOSITED (Sheet window only)
  4. CDialogResize extension called CDialogResizeDynamic to support runtime resize map manipulation


Since the property sheet class implements Wizard (97) style dialogs and default property sheets, and since I want to derive my new class from CDialogResize, I was forced to create a WTL modifications.

Instead of using static GetDlgResizeMap() I decided to use a dynamic Implementation to support runtime resize manipulation . I derived a new class from CDialogResize and added methods for adding and removing resize map entries.


Above declaration will be evaluated as

void StaticResizeMap() {
    InitialMap.Add(-1, 0);

Please note, the use of the old BEGIN_DLGRESIZE_MAP has no effect and will be ignored. StaticResizeMap method will be called within CDialogResizeDynamic constructor.

Using the code

There is not much need of code modification on your existing source code. You have to replace CPropertySheetImpl with CResizablePropertySheetImpl

class CMyPropertySheet :
    public CResizablePropertySheetImpl<CMyPropertySheet> {
    CMyPropertySheet(ATL::_U_STRINGorID title = (LPCTSTR) NULL, 
     UINT uStartPage = 0, HWND hWndParent = NULL,
    bool EnableDoubleBuffering = false, bool IsWizard = false)
    : CResizablePropertySheetImpl<CMyPropertySheet>(title, 
     uStartPage, hWndParent, EnableDoubleBuffering, IsWizard) {

As you may note constructor is extended by two additional parameters. EnableDoubleBuffering will enable double buffering (no flickering) as the name implies. IsWizard will create an wizard style property sheet. However, you should use double buffering with care because it may slow down rendering and may cause unpredictable behaviour in some circumstances.

class CMyResizablePropertyPage :
    public CResizablePropertyPageImpl<CMyResizablePropertyPage> {
    enum { IDD = IDD_0 };
    CMyResizablePropertyPage(ATL::_U_STRINGorID title = (LPCTSTR) NULL, 
     bool IsExterior = false) :
     IsExterior) {

As you may note, I extended property page constructor. If IsExterior is true, an exterior page will be created i.e. that page that usually is used for welcome and completion page.

To add, remove or change resize map items at runtime you may use one of the new CDialogResizeDynamic methods:

void AddToResizeMap(int ControlId, DWORD ResizeFlags);
void RemoveFromResizeMap(int ControlId);
void ChangeResizeMapEntry(int ControlId, DWORD ResizeFlags);

Adding new resize map groups after DlgResize_Init is called is currently not possible.


  • 2007/03/07: Added some extensions, resize map is dynamic now.
  • 2004/02/24: Initial release


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Germany Germany
Hobby: system programing (operating system and hardware)
Prefered languages are x86 assembler, c and c++.
Currently student of applied computer science at university of applied sciences Bingen (Germany)

You may also be interested in...

Comments and Discussions

GeneralExcellent But MFC!!!! Pin
MPTP13-Apr-09 23:41
memberMPTP13-Apr-09 23:41 
GeneralRe: Excellent But MFC!!!! Pin
bkausbk4-Dec-09 2:05
memberbkausbk4-Dec-09 2:05 
This implementation is dedicated to WTL/ATL. There are many MFC implementations out there but at that time this was created almost no good implementation for WTL.
GeneralExcellent Pin
Yogesh P. Dhakad1-May-07 14:40
memberYogesh P. Dhakad1-May-07 14:40 
GeneralNice, but... Pin
free2000fly3-Aug-06 21:44
memberfree2000fly3-Aug-06 21:44 
GeneralRe: Nice, but... [modified] Pin
free2000fly4-Aug-06 16:41
memberfree2000fly4-Aug-06 16:41 
GeneralRe: Nice, but... Pin
free2000fly4-Aug-06 17:02
memberfree2000fly4-Aug-06 17:02 
GeneralRe: Nice, but... Pin
bkausbk6-Mar-07 17:20
memberbkausbk6-Mar-07 17:20 
GeneralList Control on a page with double buffering causes problems Pin
michael_ro200023-Dec-05 0:27
membermichael_ro200023-Dec-05 0:27 
GeneralRe: List Control on a page with double buffering causes problems Pin
michael_ro200023-Dec-05 2:27
membermichael_ro200023-Dec-05 2:27 
GeneralRe: List Control on a page with double buffering causes problems Pin
bkausbk6-Feb-06 0:41
memberbkausbk6-Feb-06 0:41 
Generalcould you provide a full sample Pin
liuliu3-Nov-05 23:52
memberliuliu3-Nov-05 23:52 
GeneralRe: could you provide a full sample Pin
bkausbk22-Nov-05 4:38
memberbkausbk22-Nov-05 4:38 
GeneralASSERTS at start and finish Pin
Alexander D. Alexeev25-Feb-05 5:06
memberAlexander D. Alexeev25-Feb-05 5:06 
GeneralRe: ASSERTS at start and finish Pin
bkausbk25-Feb-05 5:49
memberbkausbk25-Feb-05 5:49 
GeneralRe: ASSERTS at start and finish Pin
bkausbk25-Feb-05 13:52
memberbkausbk25-Feb-05 13:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151125.3 | Last Updated 12 Mar 2007
Article Copyright 2005 by bkausbk
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid