Hi,
I would either draw on the picturebox in its paint event or draw on
a bitmap and set the pictureboxes image to the bitmap.
Dim bm As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim g As Graphics = Graphics.FromImage(bm)
' clear the image with controls background color
g.Clear(SystemColors.Control)
g.DrawLine(Pens.Red, 5, 5, 25, 25)
g.FillEllipse(Brushes.Blue, 30, 10, 10, 10)
PictureBox1.Image = bm
g.Dispose()
Ken
-----------------------
"Vasilis X" <so*****@somewhere.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hello.
I am using vb.net.
On a form i have a picture box and i draw points, lines, arcs etc in it.
When i minimize the form and then maximize it again or if the form looses
the focus for any reason
all graphics are gone and i have to redraw them.
Is there a way to make my application to display the graphics all the
time?
Thank you
Vasilis