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

📄 mybuttona.cpp

📁 用VC编的电子日记软件
💻 CPP
字号:
// MyButtona.cpp : implementation file
//

#include "stdafx.h"
#include "testd.h"
#include "MyButtona.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyButtona

CMyButtona::CMyButtona()
{
	color=RGB(255,255,255);
		
}

CMyButtona::~CMyButtona()
{
}


BEGIN_MESSAGE_MAP(CMyButtona, CButton)
	//{{AFX_MSG_MAP(CMyButtona)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyButtona message handlers

void CMyButtona::DrawItem(LPDRAWITEMSTRUCT lps) 
{
	// TODO: Add your code to draw the specified item
	CDC *dc=CDC::FromHandle(lps->hDC);
	CRect rect;
	rect.CopyRect(&lps->rcItem);
    CBrush br(color);
	dc->FillRect(&rect,&br);
	SetTimer(1,10,NULL);
}

void CMyButtona::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	InvalidateRect(NULL,false);
	KillTimer(1);
	CButton::OnTimer(nIDEvent);
}

⌨️ 快捷键说明

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