MFC Ribbon ShowContextCategories函数 获取Ribbon指针 Visual Studio 2010

MFC Ribbon ShowContextCategories函数 获取Ribbon指针 Visual Studio 2010

 

 

CMFCRibbonBar* m_pRibbon;

CMFCRibbonProgressBar* m_pProgressBar1;

 

m_pRibbon = ((CMainFrame*) AfxGetMainWnd())->GetRibbonBar();

ASSERT_VALID(m_pRibbon);

 

    m_pRibbon->ShowContextCategories(ID_CONTEXT1);

    m_pRibbon->ActivateContextCategory(ID_CONTEXT1);

 

    m_pProgressBar1 = DYNAMIC_DOWNCAST(CMFCRibbonProgressBar, m_pRibbon->FindByID(ID_CONTEXT1_CAT1_PROGRESSBAR1));

          

    if (m_pProgressBar1!=NULL)

    {

       m_pProgressBar1->SetPos(nPos);

    }

   

    if (nPos == 100)

    {

       m_pRibbon->ShowContextCategories(ID_CONTEXT1, FALSE);  

    }

 

原帖:http://hi.baidu.com/zw228/blog/item/9995624eda9d3f07b2de05f1.html

你可能感兴趣的:(mfc,2010,null,VS2010)