資源簡介
C++實戰源碼-顏色組合框(入門級實例314).zip
代碼片段和文件信息
//?ColorCombox.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“ComboBoxClr.h“
#include?“ColorCombox.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CColorCombox
CColorCombox::CColorCombox()
{
}
CColorCombox::~CColorCombox()
{
}
BEGIN_MESSAGE_MAP(CColorCombox?CComboBox)
//{{AFX_MSG_MAP(CColorCombox)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CColorCombox?message?handlers
void?CColorCombox::DrawItem(LPDRAWITEMSTRUCT?lpDrawItemStruct)?
{
//驗證是否為組合框控件
ASSERT(lpDrawItemStruct->CtlType?==?ODT_COMBOBOX);
CDC?dc?;
dc.Attach(lpDrawItemStruct->hDC);
//獲取項目區域
CRect?itemRC?(lpDrawItemStruct->rcItem);
//定義顯示顏色的區域
CRect?clrRC?=?itemRC;
//定義文本區域
CRect?textRC?=?itemRC;
//獲取系統文本顏色
COLORREF?clrText?=?GetSysColor(COLO
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2757??2009-03-09?10:08??ComboBoxClr\ColorCombox.cpp
?????文件????????1266??2008-11-26?14:24??ComboBoxClr\ColorCombox.h
?????文件????????1360??2010-10-27?13:11??ComboBoxClr\ComboBoxClr.clw
?????文件????????2133??2008-11-26?10:15??ComboBoxClr\ComboBoxClr.cpp
?????文件????????4443??2008-11-26?14:45??ComboBoxClr\ComboBoxClr.dsp
?????文件?????????547??2008-11-26?10:15??ComboBoxClr\ComboBoxClr.dsw
?????文件????????1379??2008-11-26?10:15??ComboBoxClr\ComboBoxClr.h
?????文件????????5533??2010-09-18?13:30??ComboBoxClr\ComboBoxClr.rc
?????文件????????5206??2009-01-12?14:28??ComboBoxClr\ComboBoxClrDlg.cpp
?????文件????????1572??2008-11-26?14:31??ComboBoxClr\ComboBoxClrDlg.h
?????文件?????????780??2008-11-26?14:36??ComboBoxClr\resource.h
?????文件?????????213??2008-11-26?10:15??ComboBoxClr\StdAfx.cpp
?????文件????????1054??2008-11-26?10:15??ComboBoxClr\StdAfx.h
?????文件????????5694??2008-11-26?14:36??ComboBoxClr\res\52.ico
?????文件????????1078??2008-11-26?10:15??ComboBoxClr\res\ComboBoxClr.ico
?????文件?????????403??2008-11-26?10:15??ComboBoxClr\res\ComboBoxClr.rc2
?????文件????????5632??2010-06-22?09:20??ComboBoxClr\res\Thumbs.db
- 上一篇:C++實戰源碼-將菜單項的字體設置為粗體
- 下一篇:C++實戰源碼-圖片自動預覽程序
評論
共有 條評論