From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As Boolean )
aCanvas.EraseBackground = newBooleanValue
BooleanValue = aCanvas.EraseBackground

New in 2005r1

Supported for all project types and targets.

Indicates whether the entire Canvas is erased when doing any drawing operations or resizing.


It defaults to True for backwards compatibility.

This property is only used on Windows. Its setting has no effect on macOS or Linux.

If you set DoubleBuffer to True, then you should set EraseBackground to False. Otherwise, it will cause the Canvas to flicker.


This code in the Open event handler of a Canvas enables double-buffering and disables EraseBackground:

Me.DoubleBuffer = True
Me.EraseBackground = False