Control.Update Control.Update Control.Update Control.Update Method

定義

使控制項重繪其工作區內的失效區域。Causes the control to redraw the invalidated regions within its client area.

public:
 void Update();
public void Update ();
member this.Update : unit -> unit
Public Sub Update ()

備註

執行繪製的任何暫止要求。Executes any pending requests for painting.

有兩種方式可以重新繪製的表單和其內容:There are two ways to repaint a form and its contents:

  • 您可以使用其中一個多載Invalidate方法使用Update方法。You can use one of the overloads of the Invalidate method with the Update method.

  • 您可以呼叫Refresh方法,它會強制控制項重繪本身及其所有子系。You can call the Refresh method, which forces the control to redraw itself and all its children. 這相當於設定Invalidate方法,以true,並使用它與UpdateThis is equivalent to setting the Invalidate method to true and using it with Update.

Invalidate方法控管功能取得繪製,或重新繪製。The Invalidate method governs what gets painted or repainted. Update繪製或 repainting 發生時,會控管方法。The Update method governs when the painting or repainting occurs. 如果您使用InvalidateUpdate放在一起,而不是呼叫方法Refresh,取得重新繪製項目取決於哪一個多載Invalidate您使用。If you use the Invalidate and Update methods together rather than calling Refresh, what gets repainted depends on which overload of Invalidate you use. Update方法只會強制立即執行,繪製控制項,但Invalidate方法會控管功能取得繪製呼叫時Update方法。The Update method just forces the control to be painted immediately, but the Invalidate method governs what gets painted when you call the Update method.

如需詳細資訊,請參閱 < WM_PAINT主題。For more information, see the WM_PAINT topic.

適用於

另請參閱