📄 mybutton.cpp
字号:
// MyButton.cpp : implementation file
//
#include "stdafx.h"
#include "bxt.h"
#include "MyButton.h"
#include "pic.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyButton
CMyButton::CMyButton()
{
}
CMyButton::~CMyButton()
{
}
BEGIN_MESSAGE_MAP(CMyButton, CButton)
//{{AFX_MSG_MAP(CMyButton)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyButton message handlers
void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
LPDRAWITEMSTRUCT ds = lpDrawItemStruct;
if (ds->CtlType != ODT_BUTTON) return;
if (ds->CtlID != IDOK) return;
CDC *dc = CDC::FromHandle(ds->hDC);
BOOL IsPressed = ds->itemState & ODS_SELECTED;
BOOL IsFocused = ds->itemState & ODS_FOCUS;
BOOL IsDisabled = ds->itemState & ODS_DISABLED;
RECT rc = ds->rcItem;
CString msg;
msg = "";
if (IsPressed) msg += "IsPressed ";
if (IsFocused) msg += "IsFocused ";
if (IsDisabled) msg += "IsDisabled";
// CPic pic;
if (IsPressed)
{
dc->FrameRect(
}
else
{
}
// pic.DrawBMP(dc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -