开发者

MFC Wizard Appearance

I have a MFC wizard based application (CPropertySheet, CPropertyPage) created with vS2008. I am trying to give my app which is nearly completed a more modern look. I looked into CDHTMLDIalog but it looks like a lot of work and not too well documented. Next I thought I could use some of the features of the Feature Pack. I found a thread about this link text开发者_Python百科 but have added the code mentioned in the thread to various places in my app but the appearance never changes.

CMFCVisualManagerOffice2007::SetStyle(CMFCVisualManagerOffice2007::Office2007_Silver); CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2007)); CDockingManager::SetDockingMode(DT_SMART); RedrawWindow(NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME | RDW_ERASE);

Have also replaced CPropertySheet with CMFCPropertySheet & CPropertyPage with CMFCPropertyPage

Thanks...


Define 'give my app more modern look'. I'm assuming you're not talking XP-style common controls here, but a different wizard layout. Do you want a header/banner graphic at the top or left side of your wizard? Look at the configuration parameters for the property sheet in m_psh.dwFlags : PSH_WIZARD97, PSH_WATERMARK, PSH_HEADER, ...

If you're talking about using the modern Office-style 'skins' for your wizard (Feature Pack style), you're out of luck. Can't do that for dialogs with the Feature Pack. Look into BCG Controls - it'll cost money but it's more up to date and you get extra features.

If it's something completely different what you want, please post mockups of what it should look like, and/or a screenshot of what it looks like now and what you don't like about it.


You should have:

  • CWinApp replaced with CWinAppEx in your main program file;
  • The Windows Common Controls 6.0 manifest implemented (either a RT_MANIFEST resource or a #pragma entry in your stdafx.h)
  • The code below at the beginning of the InitInstance() method (this code should have been added in the New Project wizard):

    // InitCommonControlsEx() is required on Windows XP if an application
    // manifest specifies use of ComCtl32.dll version 6 or later to enable
    // visual styles.  Otherwise, any window creation will fail.
    INITCOMMONCONTROLSEX InitCtrls;
    InitCtrls.dwSize = sizeof(InitCtrls);
    // Set this to include all the common control classes you want to use
    // in your application.
    InitCtrls.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&InitCtrls);
    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜