现在的位置: 首页 > 综合 > 正文

setredraw

2013年01月17日 ⁄ 综合 ⁄ 共 1104字 ⁄ 字号 评论关闭

CWnd::SetRedraw

This method allows changes to be redrawn or to prevent changes from being redrawn.

This method sets or clears the redraw flag. While the redraw flag is cleared, the contents will not be updated after each change and will not be repainted until the redraw flag is set. For example, an application that needs to add several items to a list box can clear the redraw flag, add the items, and then set the redraw flag. Finally, the application can call the Invalidate or InvalidateRect method to cause the list box to be repainted.

void SetRedraw(
BOOL bRedraw = TRUE ); 

Parameters

bRedraw
Specifies the state of the redraw flag. If this parameter is TRUE, the redraw flag is set; if FALSE, the flag is cleared.

Example

// 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();

Requirements

  Windows CE versions: 1.0 and later
  Header file: Declared in Afxwin.h
  Platform: H/PC Pro, Palm-size PC, Pocket PC

抱歉!评论已关闭.