Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - State changes in combo box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

State changes in combo box

 Post Reply Post Reply
Author
Message
ahsan19 View Drop Down
Newbie
Newbie


Joined: 24 March 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ahsan19 Quote  Post ReplyReply Direct Link To This Post Topic: State changes in combo box
    Posted: 24 March 2006 at 7:59pm
I have a drop-down control and I want to capture the event when the value in the combo box is changed. Here is my code for the control combo box:


CXTPControlComboBox* pComboState = (CXTPControlComboBox*)CXTPControlComboBox::CreateObject();
pComboState->AddString(_T("Win32"));

How can I add event handling to this?

Thanks.
Jessica
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 March 2006 at 9:07pm

Hi,

FROM CustomThemes sampe:

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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.