ComboBox in Toolbar - not calling OnSelChanged() |
Post Reply |
Author | |
tralfaz
Groupie Joined: 21 June 2009 Status: Offline Points: 36 |
Post Options
Thanks(0)
Posted: 01 July 2009 at 6:47pm |
I added a derived ComboBox to a toolbar. The OnSelChanged virtual function is not being called after the dropdown closes up. Am I missing a flag? Is there still no way for MainFrm to be notified when a ComboBox changes?
//.h class XComboBox: public CXTPControlComboBox { public: XComboBox(CXTPCommandBars* pCommandBars = NULL); // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(XComboBox) public: virtual void OnSelChanged(); //}}AFX_VIRTUAL }; //.cpp XComboBox::XComboBox(CXTPCommandBars* pCommandBars) : CXTPControlComboBox(pCommandBars) { } void XComboBox::OnSelChanged() { int index = this->GetCurSel(); CString text; this->GetLBText(index, text); AfxMessageBox(text); } //MainFrm.cpp int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl) { if (lpCreateControl->bToolBar) { if (lpCreateControl->nID == IDC_FONTCOMBO) { XComboBox* pCB = new XComboBox(GetCommandBars()); lpCreateControl->pControl = pCB; return true; } } return 0; } |
|
XP Pro SP3 / VS2008 C++ / Xtreme CommandBars v13.1.0 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
So did you actually change selection or just open and close it ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |