100% found this document useful (1 vote)
261 views7 pages

Ribbon Application With MFC C++

The document discusses code for customizing the interface and tab themes of a Microsoft Office-style application. It includes code for setting the application to use the Office 2007 or Windows 7 look and feel. It also includes code for handling menu button updates and changing the tab theme to options like 3D, 3D OneNote, 3D rounded, or 3D Visual Studio style.

Uploaded by

Ashhar Assasin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
261 views7 pages

Ribbon Application With MFC C++

The document discusses code for customizing the interface and tab themes of a Microsoft Office-style application. It includes code for setting the application to use the Office 2007 or Windows 7 look and feel. It also includes code for handling menu button updates and changing the tab theme to options like 3D, 3D OneNote, 3D rounded, or 3D Visual Studio style.

Uploaded by

Ashhar Assasin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Generated file after create the project

The Interface is using style of Microsoft Office 2007 theme.

Source Code for Interface


// Office 2007 style CMainFrame::CMainFrame() { // TODO: add member initialization code here theApp.m_nAppLook = theApp.GetInt(_T("ApplicationLook"), ID_VIEW_APPLOOK_OFF_2007_BLUE); }

// Change to this for Windows 7 style CMainFrame::CMainFrame() { // TODO: add member initialization code here theApp.m_nAppLook = theApp.GetInt(_T("ApplicationLook"), ID_VIEW_APPLOOK_WINDOWS_7); }

Source Code for Handle the Menu Button

void CMainFrame::OnTabLook(UINT id) { theApp.m_nTabLook = id; } theApp.WriteInt(_T("TabLook"), theApp.m_nTabLook);

void CMainFrame::OnUpdateTabLook(CCmdUI* pCmdUI) { pCmdUI->SetRadio(theApp.m_nTabLook == pCmdUI->m_nID); }

Source Code for Change the Tab Theme


void CMainFrame::OnTabLook(UINT id) { theApp.m_nTabLook = id; CMDITabInfo mdiTabParams; mdiTabParams.m_bActiveTabCloseButton = TRUE; // set to FALSE to place close button at right of tab area mdiTabParams.m_bTabIcons = FALSE; // set to TRUE to enable document icons on MDI taba mdiTabParams.m_bAutoColor = TRUE; // set to FALSE to disable auto-coloring of MDI tabs mdiTabParams.m_bDocumentMenu = TRUE; // enable the document menu at the right edge of the tab area switch (theApp.m_nTabLook) { case ID_TAB_THEME_3D: mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D; break; case ID_TAB_THEME_3D_ONENOTE: mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_ONENOTE; break;

case ID_TAB_THEME_3D_ROUNDED: mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_ROUNDED; break;


case ID_TAB_THEME_3D_VISUAL_STUDIO: mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_VS2005; break;

You might also like