![]() |
How to catch ComboBox's messages |
Post Reply
|
| Author | |
yoshinaga
Newbie
Joined: 13 February 2007 Location: Japan Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Topic: How to catch ComboBox's messagesPosted: 15 May 2008 at 1:26pm |
|
Hello,
A really silly question, but I don't know at all. I have a combobox in command bars, created in CMainFrame::OnCreate like this, m_pComboYear = (CXTPControlComboBox*)m_pToolBar->GetControls()->Add(xtpControlComboBox,ID_YEAR); I found ListBoxSample, but XTP_LBN_SELCHANGE is used for CXTPControlListBox. How can I get notify when combo box changed selection? |
|
![]() |
|
Smucker
Senior Member
Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 May 2008 at 3:56pm |
|
Here are the ones I'm using:
ON_NOTIFY(CBN_DROPDOWN, CMD_TREE_LOCATION, FillLocationCombo)HTH. |
|
![]() |
|
yoshinaga
Newbie
Joined: 13 February 2007 Location: Japan Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 May 2008 at 9:21pm |
|
Hi, HTH
Can I have more hint ablout HandleLocationCombo, FillLocationCombo. CMainFrame::HandleLocationCombo(NMHDR* pNMHDR, LRESULT* pResult) but How can I now this event is occured for which reason? Thanks a lot. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 May 2008 at 1:29am |
|
Hi,
Check CustomThemes sampe. It has Combos and handlers.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Smucker
Senior Member
Joined: 02 February 2008 Status: Offline Points: 156 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 May 2008 at 1:42pm |
|
For ON_NOTIFY, the CBN_* determines the event (drop down in this case,
so I fill the list in FillLocationCombo).
ON_XTP_EXECUTE occurs when the selection is made (picked or typed). You can get the control using: CXTPControlComboBox *pcombo = (CXTPControlComboBox *)(((NMXTPCONTROL*)pnmh)->pControl) Here is an example from my code: afx_msg void CMainFrame::HandleLocationCombo(NMHDR* pnmh, LRESULT *pres) { CXTPControlComboBox *pcombo = (CXTPControlComboBox *)(((NMXTPCONTROL*)pnmh)->pControl); if (pcombo) { ASSERT(pcombo->GetType() == xtpControlComboBox); CString foldername = pcombo->GetEditText(); m_tree.PositionToFolder(foldername); } } |
|
![]() |
|
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 |