www.gusucode.com > 基于VC编程界面编程高级应用技术源码程序 > VC界面编程高级应用技术/code/2/TaxExpert/ComboToolBar.cpp
// ComboToolBar.cpp : implementation file // #include "stdafx.h" ///#include "MyToolBar.h" #include "ComboToolBar.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CComboToolBar CComboToolBar::CComboToolBar() { } CComboToolBar::~CComboToolBar() { } BEGIN_MESSAGE_MAP(CComboToolBar, CToolBar) //{{AFX_MSG_MAP(CComboToolBar) ON_CBN_SELCHANGE(IDC_COMBOX, OnSelchangeCombo) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CComboToolBar message handlers #include "MainFrm.h" void CComboToolBar::OnSelchangeCombo() { CMainFrame* frame=(CMainFrame*)AfxGetMainWnd(); int sel=frame->m_wndToolBar.m_combobox.GetCurSel(); CString m_text; frame->m_wndToolBar.m_combobox.GetLBText(sel,m_text); // AfxMessageBox("你选择的内容是----"+m_text); }