![]() |
Can't trigger listbox selection in commandbar |
Post Reply ![]() |
Author | |
dehilster ![]() Groupie ![]() Joined: 16 October 2005 Status: Offline Points: 16 |
![]() ![]() ![]() ![]() ![]() Posted: 08 June 2011 at 9:33pm |
Looking at the samples, I am trying to trigger and event with this code:
ON_LBN_SELCHANGE(ID_LISTER_BOX, OnListerSelect) ON_UPDATE_COMMAND_UI(ID_LISTER, OnUpdateLister) ON_UPDATE_COMMAND_UI(ID_LISTER_BOX, OnUpdateLister) CXTPToolBar* pToolBarListBox = pCommandBars->Add(_T("ListBox"), xtpBarTop); pToolBarListBox->GetControls()->Add(xtpControlLabel, 0)->SetCaption(_T("CXTPControlListBox:")); CXTPControlPopup* pPopup = (CXTPControlPopup*)pToolBarListBox->GetControls()->Add(xtpControlPopup, ID_LISTER); pPopup->SetCaption(_T("ListBox")); CXTPControlListBox* pListBox = (CXTPControlListBox*)pPopup->GetCommandBar()->GetControls()->Add(new CXTPControlListBox, ID_LISTER_BOX); pListBox->GetListCtrl()->AddString(_T("Item 1")); pListBox->GetListCtrl()->AddString(_T("Item 2")); void CMainFrame::OnListerSelect() { int i = 0; // this is just a BREAKPOINT } void CMainFrame::OnUpdateLister(CCmdUI* pCmdUI) { pCmdUI->Enable(true); } However, it never makes it to BREAKPOINT I need to get an event triggered in choosing a list item in a command bar. Help! -David Long Beach, CA
|
|
David de Hilster
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Please check CommandBars\ListBoxSamples.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
dehilster ![]() Groupie ![]() Joined: 16 October 2005 Status: Offline Points: 16 |
![]() ![]() ![]() ![]() ![]() |
Thanks! I saw that one but only now realize the list box was the undo buttons. I will let you know how it works out.
|
|
David de Hilster
|
|
![]() |
|
dehilster ![]() Groupie ![]() Joined: 16 October 2005 Status: Offline Points: 16 |
![]() ![]() ![]() ![]() ![]() |
Yes, this works. Thanks!
|
|
David de Hilster
|
|
![]() |
|
jintian01 ![]() Newbie ![]() ![]() Joined: 10 December 2011 Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
How do you resolve it ?Can you past your code section to me? |
|
![]() |
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 |