Window.Invalidate

From Xojo Documentation

Method

Window.Invalidate([EraseBackground as Boolean])

Supported for all project types and targets.

Similar to Refresh, but causes the window to be marked dirty and to be redrawn when the window contents need to be redrawn.

Notes

If the optional parameter EraseBackground is True, the background will be erased prior to redrawing the window. The default is True.


Method

Window.Invalidate(X As Integer, Y As Integer, Width As Integer, Height As Integer [,EraseBackground as Boolean])

Supported for all project types and targets.

Similar to RefreshRect, but causes the specified region of the window to be marked dirty and to be redrawn when the window contents need to be redrawn. The region to be redrawn is specified by the X, Y, Width, and Height parameters.

If the optional parameter EraseBackground is True, the background will be erased prior to redrawing the window. The default is True.

Notes

To redraw a window immediately, call Refresh or Refreshrect. For example, this would be appropriate from a tight loop, if you need the screen to be updated but there is no chance for your application's main event loop to execute in the meantime.

Otherwise, it is generally more efficient to call Invalidate, which tells the operating system that the window (or part of it) needs to be redrawn. The advantage of this approach is that more than one part of the screen might be invalidated before the next general screen refresh, and the operating system can wait until that refresh to repaint all invalid regions of the screen at once.

Example

The following example refreshes the window. EraseBackground defaults to True.

Self.Invalidate