monthcombobox.cpp
来自「管理项目进度工具的原代码」· C++ 代码 · 共 61 行
CPP
61 行
// monthcombobox.cpp : implementation file
//
#include "stdafx.h"
#include "monthcombobox.h"
#include "datehelper.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMonthComboBox
CMonthComboBox::CMonthComboBox()
{
}
CMonthComboBox::~CMonthComboBox()
{
}
BEGIN_MESSAGE_MAP(CMonthComboBox, CComboBox)
//{{AFX_MSG_MAP(CMonthComboBox)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMonthComboBox message handlers
void CMonthComboBox::PreSubclassWindow()
{
InitCombo();
CComboBox::PreSubclassWindow();
}
int CMonthComboBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CComboBox::OnCreate(lpCreateStruct) == -1)
return -1;
InitCombo();
return 0;
}
void CMonthComboBox::InitCombo()
{
ASSERT(GetSafeHwnd());
ResetContent();
for (int nMonth = 1; nMonth <= 12; nMonth++)
AddString(CDateHelper::GetMonth(nMonth, FALSE));
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?