ComboToolBar.cpp
Upload User: szcysw
Upload Date: 2013-03-11
Package Size: 6752k
Code Size: 1k
Category:

GUI Develop

Development Platform:

Visual C++

  1. // ComboToolBar.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. ///#include "MyToolBar.h"
  5. #include "ComboToolBar.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CComboToolBar
  13. CComboToolBar::CComboToolBar()
  14. {
  15. }
  16. CComboToolBar::~CComboToolBar()
  17. {
  18. }
  19. BEGIN_MESSAGE_MAP(CComboToolBar, CToolBar)
  20. //{{AFX_MSG_MAP(CComboToolBar)
  21. ON_CBN_SELCHANGE(IDC_COMBOX, OnSelchangeCombo)
  22. // NOTE - the ClassWizard will add and remove mapping macros here.
  23. //}}AFX_MSG_MAP
  24. END_MESSAGE_MAP()
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CComboToolBar message handlers
  27. #include "MainFrm.h"
  28. void CComboToolBar::OnSelchangeCombo()
  29. {
  30. CMainFrame*  frame=(CMainFrame*)AfxGetMainWnd();
  31. int sel=frame->m_wndToolBar.m_combobox.GetCurSel();
  32. CString m_text;
  33. frame->m_wndToolBar.m_combobox.GetLBText(sel,m_text);
  34. // AfxMessageBox("你选择的内容是----"+m_text);
  35. }