I am using Managed extensions for C++ in .NET. My program must draw some rectangles on a panel, that is in the main form. I am using "Graphics g=panel->CreateGraphics();" and then use this "g" in order to draw some stuff. How do I manage to erase all the painted stuff? Changing the background color of the panel is not a solution.