Invalidate(false)和在OnEraseBkgnd中return false有什么区别啊?

fat_how 2003-08-24 01:46:32
在使客户区重绘时要背景不erase,用
Invalidate(false);

在OnEraseBkgnd中立即返回
都可以做到,他们有什么区别吗?
...全文
106 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhouyong0371 2003-08-26
  • 打赏
  • 举报
回复
Invalidate(TRUE);
会激发OnEraseBkgnd,而OnEraseBkgnd的结果表明OnEraseBkgnd成功与否。
Invalidate(FALSE);表示不掉用OnEraseBkgnd
zhouyong0371 2003-08-26
  • 打赏
  • 举报
回复
CWnd::Invalidate
This method invalidates the entire client area of CWnd.

void Invalidate(
BOOL bErase = TRUE );
Parameters
bErase
Specifies whether the background within the update region is to be erased.
zhouyong0371 2003-08-26
  • 打赏
  • 举报
回复
CWnd::OnEraseBkgnd
This method is called by the framework when the CWnd object background needs erasing. For example, when a window is resized. It is called to prepare an invalidated region for painting.

afx_msg BOOL OnEraseBkgnd(
CDC* pDC );
Parameters
pDC
Specifies the device-context object.
Return Value
Nonzero if it erases the background; otherwise, it is zero.

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧