I'm developing an MFC Ribbon application on visual studio 2013 and I'm new in MFC developement. I've added MFC Ribbon ComboBox from designer window. Now, I want to add data runtime into MFC Ribbon ComboBox, I've done google & read MSDN as well as Code Project example regarding MFC Ribbon. but, I was unable to figured how to get pointer to combobox and add data into it.
1
votes
1 Answers
1
votes
You can use CMFCRibbonBar::FindByID. So, something like this:
CMFCRibbonComboBox *pCombo = DYNAMIC_DOWNCAST(CMFCRibbonComboBox,
m_wndRibbonBar.FindByID(ID_COMBO1));
The ID you use (in the above example ID_COMBO1
) is the ID you gave it in the Properties window in the ribbon designer, and m_wndRibbonBar
is the member variable of the ribbon itself, which is usually auto-generated in your CMainFrm
class.