CWnd::SetRedraw
更新 : 2007 年 11 月
アプリケーションは SetRedraw 関数を呼び出して、再描画の許可または禁止を行います。
void SetRedraw(
BOOL bRedraw = TRUE
);
パラメータ
- bRedraw
再描画フラグの状態を指定します。このパラメータが TRUE の場合は再描画フラグが設定され、FALSE の場合はクリアされます。
解説
このメンバ関数では、再描画フラグの設定またはクリアを行います。再描画フラグがクリアされている場合は、その内容は各種の変更後も更新されず、再描画フラグが設定されるまで再描画されません。たとえば、リスト ボックスへいくつかの項目を追加する必要があるアプリケーションは、まず再描画フラグをクリアし、項目追加後に再描画フラグを設定します。さらに、最後に Invalidate または 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();
必要条件
ヘッダー : afxwin.h