Private m_BufferBitmap As Bitmap
Private m_BufferGraphics As Graphics
OnLoad **************
m_BufferBitmap = New Bitmap(Me.Size.Width, Me.Size.Height,
Me.CreateGraphics())
m_BufferGraphics = Graphics.FromImage(m_BufferBitmap)
' Clear the new bitmap.
m_BufferGraphics.Clear(Me.BackColor)
*********************
Note: Drawing in the surface should be using m_BufferGraphics object..
On Paint ***************
If Not (m_BufferBitmap Is Nothing) Then e.Graphics.DrawImage(m_BufferBitmap,
0, 0)
**********************
Thanks for the direction Herfried
Regards
Rohan
"Herfried K. Wagner [MVP]" wrote:
"Rohan" <Ro***@discussions.microsoft.com> schrieb: If I switch from the Form i have drwan my graphics like Rectangle to some
other Window and come back to my graphic window the drawing is
disappeared.
Handle the form's 'Paint' event or override its 'OnPaint' method and draw
the rectangles there ('e.Graphics.Draw*'). The form must be repainted every
time its contents are overlapped by another window.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>