From Xojo Documentation
Similar to Refresh, but causes the window to be marked dirty and to be redrawn when the window contents need to be redrawn.
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.
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.
The following example refreshes the window. EraseBackground defaults to True.