Change window's background with button

I would have so many backgrounds in my program. I wish with a button there is a change of the background itself. Then a series of backgrounds that vary by a button. it’s possible to do it? I need a database?
Thank you in advance and I apologize for my lack of preparation but I’m still a student who approached xojo recently

Use the Paint event of the window rather than the background property. In the Paint event, set a variable to determine which background pic or color to draw. Change the variable in your button action event. Now just call window1.invalidate whenever the value of that variable has changed.

Painting to the background in Windows will badly flicker.

You can doing an example?