荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: littlebao (爱拼才会赢), 信区: Visual
标  题: Re: 如何刷新视图?
发信站: 荔园晨风BBS站 (Thu Jul 17 23:11:53 2003), 站内信件

This is the example from the CWnd::UpdateWindow method.

// In this example a rectangle is drawn in a view.
// The OnChangeRect() function changes the dimensions
// of the rectangle and then calls CWnd::Invalidate() so the
// client area of the view will be redrawn next time the
// window is updated.  It then calls CWnd::UpdateWindow
// to force the new rectangle to be painted.

void CTestView::OnChangeRect()
{
  // Change Rectangle size.
  m_rcBox = CRect(20, 20, 210, 210);

  // Invalidate window so entire client area
  // is redrawn when UpdateWindow is called.

 Invalidate();  //发出 WM_PAINT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  // Update Window to cause View to redraw.

//UpdateWindow()强制刷新
  UpdateWindow();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}

// On Draw function draws the rectangle.
void CTestView::OnDraw(CDC* pDC)
{
//  ..  Other draw code here.

  pDC->Draw3dRect(m_rcBox, 0x00FF0000, 0x0000FF00);
}


【 在 Chengal (浩气冲天) 的大作中提到: 】
: 能不能发一个消息阿
: wm_paint
: 之类的
: 【 在 contonazhao (烦恼的松鼠仔) 的大作中提到: 】
: : 有没有什么reFreshView之类的函数阿?


--
※ 来源:·荔园晨风BBS站 bbs.szu.edu.cn·[FROM: 192.168.79.110]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店