Canvas or Background?

If I have a Container Control is it best use the Paint of the CC or cover the CC with a canvas and paint to the canvas? Refresh vrs. Invalidate I guess as CC don’t use Invalidate. The picture will be changing with mouse movements. TIA

I set a Canvas inside the ContainerControl and put code into the Canvas. To access to the Canvas code, use ContainerControl.Canvas1.<whatever>.

There is nothing wrong with using the paint event of the CC to draw your pic if that keeps your code simpler. Yes, you can call .invalidate on a CC. If the drawing you need to do becomes more complicated, then a canvas might be a better solution.

How do you call invalidate on a CC I get an error when I use me.Invalidate or self.invalidate in the Open event for testing. rb2012 r2

No error here using Xojo 2016r3 on Mac OS 10.11.
There version you are using is over 4 years old. Something may have changed.

To replace invalidate, switch between invisible and visible.

Is that ‘better’ (I use the term lightly) then Refresh?

[quote=292274:@Roger Clary]No error here using Xojo 2016r3 on Mac OS 10.11.
There version you are using is over 4 years old. Something may have changed.[/quote]
Probably, I use it RB so infrequently and nothing I’m writing needs anything newer than rb2012 there’s been no reason to upgrade.

Yes.
Invalidate is a request, and it happens after your method is complete.
Refresh is more DO THIS NOW.

It’s more the equivalent of Refresh, and it is the only equivalent of Invalidate available in RS without a declare.

But if you have Refresh, go ahead.

Thanks all