BCGControlBar Pro for MFC最新試用版下載請猛戳>>>html
本文主要介紹如何將現有的MFC應用程序添加到BCGControlBar Pro中(若是您想要建立一個全新的應用程序,請使用咱們的Application Wizard)。讓咱們想象您已經擁有了一個具備菜單、工具欄和狀態欄的典型MFC應用程序。在您的代碼中作如下更改:函數
1. 將如下代碼添加到stdafx.h文件中:工具
1this |
|
所須要的庫將會自動連接您的項目——您沒必要在項目連接器設置中添加它。假設咱們 的集成嚮導已正確完成,您的Visual Studio C++文件夾列表已經包含到BCGControlBar Pro目錄中。code
2. 從CBCGPWinApp中派生您的應用程序類:htm
1對象 |
|
3. 請確保在您應用程序的InitInstance()中調用CBCGPWinApp::InitInstance()和AfxOleInit()。ci
4. 添加如下調用InitInstance(): SetRegistryKey(_T("MyCompany\\MyProduct"));
5. 在您應用程序ExitInstance()中調用BCGCBProCleanUp()。
6.下面的類名使用全局替換:
7. 若是您想添加Microsoft Office 2007/2010/2013/2016樣式的功能導航欄,請閱讀如下文章來了解這種技術:
8. 添加嵌入式菜單欄對象到您的CMainFrame類中:CBCGPMenuBar m_wndMenuBar,同時在CMainFrame::OnCreate:中建立該對象。
1 2 3 |
|
9. 在您應用程序的構造函數開頭設置應用程序可視化樣式:
1 |
|
其中,主題是:
BCGP_VISUAL_THEME_DEFAULT | Windows native theme |
BCGP_VISUAL_THEME_OFFICE_2000 | MS Office 2000/VC++ 6.0 look |
BCGP_VISUAL_THEME_OFFICE_XP | MS Office XP/Visual Studio.NET look |
BCGP_VISUAL_THEME_OFFICE_2003 | MS Office 2003 look |
BCGP_VISUAL_THEME_VS_2005 | Visual Studio 2005 look |
BCGP_VISUAL_THEME_OFFICE_2007_BLUE | MS Office 2007 look (blue) |
BCGP_VISUAL_THEME_OFFICE_2007_BLACK | MS Office 2007 look (black) |
BCGP_VISUAL_THEME_OFFICE_2007_SILVER | MS Office 2007 look (silver) |
BCGP_VISUAL_THEME_OFFICE_2007_AQUA | MS Office 2007 look (aqua) |
BCGP_VISUAL_THEME_CARBON | Carbon |
BCGP_VISUAL_THEME_VS_2008 | Visual Studio 2008 look |
BCGP_VISUAL_THEME_VS_2010 | Visual Studio 2010 look |
BCGP_VISUAL_THEME_OFFICE_2010_BLUE | MS Office 2010 look (blue) |
BCGP_VISUAL_THEME_OFFICE_2010_BLACK | MS Office 2010 look (black) |
BCGP_VISUAL_THEME_OFFICE_2010_SILVER | MS Office 2010 look (silver) |
BCGP_VISUAL_THEME_SCENIC | Windows 7/8 Ribbon look. |
BCGP_VISUAL_THEME_VS_2012_LIGHT | Visual Studio 2012 look (light) |
BCGP_VISUAL_THEME_VS_2012_DARK | Visual Studio 2012 look (dark) |
BCGP_VISUAL_THEME_VS_2012_BLUE | Visual Studio 2012 look (blue) |
BCGP_VISUAL_THEME_OFFICE_2013_WHITE | MS Office 2013 look (white) |
BCGP_VISUAL_THEME_OFFICE_2013_GRAY | MS Office 2013 look (gray) |
BCGP_VISUAL_THEME_OFFICE_2013_DARK_GRAY | MS Office 2013 look (dark gray) |
BCGP_VISUAL_THEME_OFFICE_2016_WHITE | MS Office 2016 look (white) |
BCGP_VISUAL_THEME_OFFICE_2016_COLORFUL | MS Office 2016 look (colorful) |
BCGP_VISUAL_THEME_OFFICE_2016_DARK_GRAY | MS Office 2016 look (dark gray) |
有興趣的朋友點擊查看更多BCG教程>>