Refresh Method  
 

Reloads the current page, revalidating cached resources with the server if applicable.

Syntax

object.Refresh

Parameters

None.

Return Value

Returns True if the method succeeds or False if the method fails.

Remarks

The Refresh method reloads the current document and forces both the host window and the embedded WebView2 child window to repaint themselves. This differs from Reload, which simply reloads the page (similar to pressing F5) but does not explicitly invalidate and redraw the hosting window.

Internally, this method clears the browser cache and then forces a redraw by updating the control bounds and notifying the browser that the parent window has changed. If the host window itself is visible, it is also invalidated and updated to ensure that the client area is repainted.

Because this method performs multiple operations that can be relatively expensive, applications should generally prefer Reload unless a complete repaint of both the control and the host window is required. For example, it can be used if rendering artifacts are visible after a resize or when switching between different DPI contexts.

See Also

Reload Method, Reset Method