![]() |
Toolbar ComboBox event |
Post Reply ![]() |
Author | |
suchout ![]() Groupie ![]() Joined: 29 September 2009 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() Posted: 28 October 2009 at 2:10am |
Hi,
<in dll >
i developed combobox in toolbar and add three items in combobox.
CXTPControlComboBox* pControlCombo = (CXTPControlComboBox*)m_pToolBar->GetControls()->Add(xtpControlComboBox , m_ToolbarID[0]); pControlCombo->AddString(_T("abc")); pControlCombo->AddString(_T("def")); pControlCombo->AddString(_T("hij")); <in main program> when i execute program , i clicked one item of three items
![]() in Event handling , catched combobox's id.
and show item text in messagebox ,
ON_COMMAND_EX_RANGE(MSG_START, MSG_END, OnUserId)
int CTEST1App::OnUserId(UINT nID)
{ int rtn; EVENT_Info eventinfo; CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd(); rtn = 1; switch(nID) {
...
case ID_TB_COMBO1:
break;
...
}
}
![]() and An unknown error has occured.
![]() .. ㅠㅠ i think i have a hole in my head..
please help me..
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Please. click Retry and show full stack.
What Toolkit version do you have ?
btw its not very good way to determine what control was executed. Search in our samples ON_XTP_EXECUTE.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
suchout ![]() Groupie ![]() Joined: 29 September 2009 Status: Offline Points: 13 |
![]() ![]() ![]() ![]() ![]() |
Hi,
this is call stack ,
![]() and i use toolkit v13.1.0
and i can't found ON_XTP_EXECUTE ....
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
See CustomThemes sample:
ON_XTP_EXECUTE(ID_EDIT_STATE, OnEditState)
void CMainFrame::OnEditState(NMHDR* pNMHDR, LRESULT* pResult)
{ NMXTPCONTROL* tagNMCONTROL = (NMXTPCONTROL*)pNMHDR; CXTPControlComboBox* pControl = (CXTPControlComboBox*)tagNMCONTROL->pControl;
if (pControl->GetType() == xtpControlComboBox) { int nState = pControl->GetCurSel(); if (nState != 2) { m_nState = nState; } else { MessageBox(_T("Configuration Manager")); pControl->SetCurSel(m_nState); } *pResult = TRUE; // Handled } } |
|
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 |