CWnd::SetRedraw

应用程序调用 SetRedraw 允许更改都重绘或阻止重新绘制的更改。

void SetRedraw( 
   BOOL bRedraw = TRUE  
);

参数

  • bRedraw
    指定重绘标志的状态。 如果此参数是 TRUE,就设置了标志;如果设置为,则清除标志 FALSE

备注

此成员函数设置或清除重绘标志。 清除重绘标志,内容将不会更新,每次更改,并且不会重新绘制后,直到重绘标志设置为。 例如,需要将多个项添加到列表框的应用程序可能会清除重绘标志,添加项,然后将重绘标志。 最后,应用程序可以调用 无效InvalidateRect 成员函数引起列表框被重新绘制。

示例

// Updating a control or window with large amounts of data may cause  
// flicker. In such cases it may be better to turn off drawing 

//m_list is a member of type CListCtrl
m_List.SetRedraw(FALSE);  // turn drawing off regardless of list mode 

// 
// Update control 
//

m_List.SetRedraw(TRUE);  // turn drawing back on and update the window 

// invalidate the entire control, force painting
m_List.Invalidate();
m_List.UpdateWindow();

要求

Header: afxwin.h

请参见

参考

CWnd 类

层次结构图

WM_SETREDRAW