MFC Ribbon 获取 ComBox,Slider,Edit等方法

ComBox:
  CMFCRibbonComboBox *pOPComboBox = DYNAMIC_DOWNCAST(CMFCRibbonComboBox, m_wndRibbonBar.FindByID(ID_COMBO));
  int nIndex = pOPComboBox->GetCurSel();
  CString strCBText;
  strCBText = pOPComboBox->GetItem(nIndex);
  Ctest2View* pView = (Ctest2View*)GetActiveView();
  //pView->OnSetStatusOp(strCBText); 

Slider:
 CMFCRibbonSlider* pSlider = DYNAMIC_DOWNCAST(CMFCRibbonSlider, m_wndRibbonBar.FindByID(ID_SLIDER3));
 Ctest5View* pView = (Ctest5View*)GetActiveView();
 pView->m_nAlpha3 = pSlider->GetPos();
 //pView->Set32BitBmpAlpha(pView->m_bmp3,pView->m_nAlpha3);
 //pView->Draw32BitBMP(pView->m_bmp3);

Eidt: 
 CMFCRibbonEdit* pEdit = DYNAMIC_DOWNCAST(CMFCRibbonEdit, m_wndRibbonBar.FindByID(ID_A3));
 CString strLable;
 strLable.Format(_T("%d"),pSlider->GetPos());
 pEdit->SetEditText(strLable); 

你可能感兴趣的:(MFC Ribbon 获取 ComBox,Slider,Edit等方法)