⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 headcombo.cpp

📁 实现了一个象qq 一样的头像列表
💻 CPP
字号:
// HeadCombo.cpp : implementation file
//

#include "stdafx.h"
#include "HeadDemo.h"
#include "HeadCombo.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHeadCombo

CHeadCombo::CHeadCombo()
{

}

CHeadCombo::~CHeadCombo()
{
}


BEGIN_MESSAGE_MAP(CHeadCombo, CComboBox)
	//{{AFX_MSG_MAP(CHeadCombo)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHeadCombo message handlers

void CHeadCombo::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
	// TODO: Add your code to draw the specified item
	CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
	HICON hIcon = (HICON)lpDrawItemStruct->itemData; // HICON in Item data

	if (lpDrawItemStruct->itemAction & ODA_DRAWENTIRE)
	{
		pDC->DrawIcon(lpDrawItemStruct->rcItem.left+5,lpDrawItemStruct->rcItem.top+5,hIcon);
	}	
}

void CHeadCombo::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) 
{
	// TODO: Add your code to determine the size of specified item
	lpMeasureItemStruct->itemHeight = 42;
	lpMeasureItemStruct->itemWidth = 42;	
}

int CHeadCombo::AddIconItem(HICON hIcon)
{
	return AddString((LPCTSTR) hIcon);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -