Hi,

I have some problems when drawing dot or lines in picturebox. If I do minimize and maximize the form after finishing my drawing, all of my drawing will be lost. I can't see any more.
How should I handle this situtation?

Regards,
Zawpai

Where is your code? (Which method of which object?)
It should be in the paint method of the picturebox (something like PictureBox1_Paint) so it will automatically be run whenever it is needed. If you put it somewhere else it is not necessarily called when the form is re-drawn, so your drawing is lost.

Hi SalmiSoft,

I didn't use "PictureBox1_Paint". I only use these two commands.

picDrawing.PSet (x, y), vbGreen
picDrawing.Line (x, y)-(tempPos1(0), tempPos1(1)), vbGreen

I have done a testing. Your way also will lost the drawing. If I set "PictureBox.AutoRedraw = True", everything is working fine.
Thanks for your reply.

Rgards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.