【VC开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VC开源代码-WhiteFrame.cpp的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
// WhiteFrame.cpp : implementation file
//
#include "stdafx.h"
#include "a1.h"
#include "WhiteFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWhiteFrame
CWhiteFrame::CWhiteFrame()
{
}
CWhiteFrame::~CWhiteFrame()
{
}
BEGIN_MESSAGE_MAP(CWhiteFrame, CStatic)
//{{AFX_MSG_MAP(CWhiteFrame)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWhiteFrame message handlers
void CWhiteFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting
CString str;
this->GetWindowText(str);
CRect rect;
this->GetClientRect(&rect);
dc.FillSolidRect(rect,RGB(254,254,254));
if(str!="")
{
CFont* font=this->GetFont();
dc.SetBkColor(RGB(254,254,254));
dc.SelectObject(font);
dc.TextOut(0,0,str);
}
else
{
dc.MoveTo(rect.left,rect.top);
dc.LineTo(rect.left,rect.bottom);
dc.MoveTo(rect.left,rect.top);
dc.LineTo(rect.right,rect.top);
COLORREF clrBtnShadow,clrBtnHilite,clrBtnDkShadow,clrBtnLight;
clrBtnShadow = ::GetSysColor(COLOR_BTNSHADOW);
clrBtnDkShadow = ::GetSysColor(COLOR_3DDKSHADOW);
clrBtnLight = ::GetSysColor(COLOR_3DLIGHT);
clrBtnHilite = ::GetSysColor(COLOR_BTNHIGHLIGHT);
dc.DrawEdge(rect,EDGE_RAISED,BF_BOTTOM|BF_RIGHT);
}
}