Visual Studio Developer Center > Visual C++ Forums > Visual C++ MFC and ATL > MFC: Windows 7 Ribbon tooltips are not the same as Office 2007 tooltips

Answered MFC: Windows 7 Ribbon tooltips are not the same as Office 2007 tooltips

  • Thursday, April 15, 2010 8:48 PM
     
     

    Using the Windows 7 style Ribbon, the tooltips are yellow and ugly compared to the tooltips used by the Office 2007 style.

    How can I make the Windows 7 ribbon style use the better looking tooltips?

    ...Matt

Answers

  • Thursday, April 29, 2010 4:54 PM
    Owner
     
     Answered

    Hi Matt,

    Thanks for the report.  I had not noticed this behavior before, and it is definitely a bug in MFC.

    However, you can work around it this way.  Modify your application's OnApplicationLook method by adding the code below in red bold:

    void CMainFrame::OnApplicationLook(UINT id)

    {

           CWaitCursor wait;

     

           theApp.m_nAppLook = id;

     

           CMFCToolTipInfo ttParams;

           ttParams.m_bVislManagerTheme = TRUE;

     

           switch (theApp.m_nAppLook)

           {

           case ID_VIEW_APPLOOK_WINDOWS_7:

                  CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows7));

     

                  ttParams.m_bVislManagerTheme = FALSE;

                  ttParams.m_bDrawSeparator = FALSE;

                  ttParams.m_clrFillGradient = afxGlobalData.clrBarFace;

                  ttParams.m_clrFill = RGB(255, 255, 255);

                  ttParams.m_clrBorder = afxGlobalData.clrBarShadow;

                  ttParams.m_clrText = afxGlobalData.clrBarText;

     

                  CDockingManager::SetDockingMode(DT_SMART);

                  m_wndRibbonBar.SetWindows7Look(TRUE);

                  break;

           ….

           }

     

           ….

           theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,

                  RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);

    }

    I hope this helps!

    Pat Brenner, Visual C++ Libraries Development

    • Marked As Answer by Matt Houser Monday, June 28, 2010 3:58 PM
    •  

All Replies

  • Thursday, April 29, 2010 4:54 PM
    Owner
     
     Answered

    Hi Matt,

    Thanks for the report.  I had not noticed this behavior before, and it is definitely a bug in MFC.

    However, you can work around it this way.  Modify your application's OnApplicationLook method by adding the code below in red bold:

    void CMainFrame::OnApplicationLook(UINT id)

    {

           CWaitCursor wait;

     

           theApp.m_nAppLook = id;

     

           CMFCToolTipInfo ttParams;

           ttParams.m_bVislManagerTheme = TRUE;

     

           switch (theApp.m_nAppLook)

           {

           case ID_VIEW_APPLOOK_WINDOWS_7:

                  CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows7));

     

                  ttParams.m_bVislManagerTheme = FALSE;

                  ttParams.m_bDrawSeparator = FALSE;

                  ttParams.m_clrFillGradient = afxGlobalData.clrBarFace;

                  ttParams.m_clrFill = RGB(255, 255, 255);

                  ttParams.m_clrBorder = afxGlobalData.clrBarShadow;

                  ttParams.m_clrText = afxGlobalData.clrBarText;

     

                  CDockingManager::SetDockingMode(DT_SMART);

                  m_wndRibbonBar.SetWindows7Look(TRUE);

                  break;

           ….

           }

     

           ….

           theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,

                  RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);

    }

    I hope this helps!

    Pat Brenner, Visual C++ Libraries Development

    • Marked As Answer by Matt Houser Monday, June 28, 2010 3:58 PM
    •  
  • Monday, June 28, 2010 3:59 PM
     
     

    Yes, this fixes it.

    Thanks,

    ...Matt

  • Monday, July 05, 2010 11:58 PM
     
     

    Matt,

    Good that the workaround is helpful for you. We have also fixed this issue and the fix will be available in the next version of Visual Studio.

    Thanks for reporting the issue.

    Mohammad Usman
    Visual C++ Libraries QA

  • Thursday, May 17, 2012 3:49 PM
     
     

    For applications ported from older (pre-ribbon) versions of MFC, OnApplicationLook() may not be implemented.  In that case, the above code needs to be inserted in CMainFrame::OnCreate() before the call to m_wndRibbonBar.Create() in order to be effective.

    -Kevin Wasserman