ID:【118】
类型:Demo
开发工具:VS2017
简介:重绘的CListBox,可以在列表中显示对应的颜色框。
效果:
头文件:
#pragma once
// CMyListBox
class CMyListBox : public CListBox
{
DECLARE_DYNAMIC(CMyListBox)
public:
CMyListBox();
virtual ~CMyListBox();
protected:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);;
virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
DECLARE_MESSAGE_MAP()
};
源文件:
// CMyListBox.cpp: 实现文件
//
#include "pch.h"
#include "A1.h"
#include "CMyListBox.h"
// CMyListBox
IMPLEMENT_DYNAMIC(CMyListBox, CListBox)
CMyListBox::CMyListBox()
{
}
CMyListBox::~CMyListBox()
{
}
BEGIN_MESSAGE_MAP(CMyListBox, CListBox)
END_MESSAGE_MAP()
// CMyListBox 消息处理程序
void CMyListBox::DrawIte