www.pudn.com > ODBCApi.rar > ItemComboBox.cpp
// ItemComboBox.cpp : 实现文件
//
#include "stdafx.h"
#include "ItemComboBox.h"
#include ".\itemcombobox.h"
// CItemComboBox
IMPLEMENT_DYNAMIC(CItemComboBox, CComboBoxEx)
CItemComboBox::CItemComboBox()
{
}
CItemComboBox::~CItemComboBox()
{
}
BEGIN_MESSAGE_MAP(CItemComboBox, CComboBoxEx)
ON_CONTROL_REFLECT(CBN_SELCHANGE, OnCbnSelchange)
ON_WM_CREATE()
END_MESSAGE_MAP()
// CItemComboBox 消息处理程序
void CItemComboBox::OnCbnSelchange()
{
CWnd* pWnd = GetParent();
if(pWnd!=NULL)
{
::PostMessage(pWnd->m_hWnd, CN_CHANGE, 0, 0);
}
}
int CItemComboBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CComboBox::OnCreate(lpCreateStruct) == -1)
return -1;
CFont tpFont;
tpFont.CreateStockObject(DEFAULT_GUI_FONT);
SetFont(&tpFont);
tpFont.DeleteObject();
return 0;
}