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

📄 basestatic.cpp

📁 用VC+SQL实现的物流管理系统 “RxMediaPlayer” 文件夹中存放《物流综合管理系统》中《媒体播放平台》源程序 “数据库设置”文件夹中存放《物流综合管理系统》辅助工具《数据库设置》源程
💻 CPP
字号:
// BaseStatic.cpp : implementation file
//

#include "stdafx.h"
#include "MyProject.h"
#include "BaseStatic.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBaseStatic

CBaseStatic::CBaseStatic()
{
}

CBaseStatic::~CBaseStatic()
{
}


BEGIN_MESSAGE_MAP(CBaseStatic, CStatic)
	//{{AFX_MSG_MAP(CBaseStatic)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBaseStatic message handlers

void CBaseStatic::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	dc.SetBkColor(m_bkColor);
	dc.SetTextColor(m_TextColor);
	CFont * pfont=this->GetParent()->GetFont();
	CFont * pf;
	pf=dc.SelectObject(pfont);
	// TODO: Add your message handler code here
	CString sCaption;
	this->GetWindowText(sCaption);
	CRect rcWnd;
	this->GetClientRect(&rcWnd);
	dc.DrawText(sCaption,rcWnd,DT_VCENTER|DT_SINGLELINE);
	::DeleteObject(pfont);
	// Do not call CStatic::OnPaint() for painting messages
}

void CBaseStatic::SetBkColor(COLORREF bkColor)
{
	m_bkColor=bkColor;
}
void CBaseStatic::SetTextColor(COLORREF TextColor)
{
	m_TextColor=TextColor;
}	

void CBaseStatic::PreSubclassWindow() 
{
	SetTextColor();
	SetBkColor();
	CStatic::PreSubclassWindow();
}

⌨️ 快捷键说明

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