HoverEdit.cpp
资源名称:VC++Excel.rar [点击查看]
上传用户:jinq198
上传日期:2014-05-21
资源大小:111k
文件大小:1k
源码类别:
文件操作
开发平台:
Visual C++
- // HoverEdit.cpp : implementation file
- // Modified by jingzhou xu
- #include "stdafx.h"
- #include "HoverEdit.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CHoverEdit
- CHoverEdit::CHoverEdit()
- {
- }
- CHoverEdit::~CHoverEdit()
- {
- }
- BEGIN_MESSAGE_MAP(CHoverEdit, CEdit)
- //{{AFX_MSG_MAP(CHoverEdit)
- ON_WM_NCPAINT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CHoverEdit message handlers
- void CHoverEdit::OnHoverEnter()
- {
- Redraw();
- }
- void CHoverEdit::OnHoverLeave()
- {
- Redraw();
- }
- void CHoverEdit::Redraw()
- {
- RedrawWindow(NULL,NULL,RDW_FRAME|RDW_INVALIDATE);
- }
- void CHoverEdit::OnNcPaint()
- {
- CWindowDC DC(this);
- CRect Rect;
- GetWindowRect(&Rect);
- if (IsHover())
- DC.Rectangle(0,0,Rect.Width(),Rect.Height());
- else
- DC.DrawEdge(CRect(0,0,Rect.Width(),Rect.Height()),EDGE_SUNKEN,BF_FLAT|BF_RECT);
- }