How to paint 4 panels on a form separately at the same time without flicker

V

vahid.xplod

hi,
i've got a big problem with painting 4 or more than 4 control such as
panel on a form.
i have 4 panel that their width and height is 3000px on form and also a
hscrollbal control that when i move the scroll bar the 4 panels move
with it.
but my problem is when i want to paint a grid on the form or anything
with paint event i come across flicker.
i think there is something wrong with DrawGrid function that i've
written.

can anyone tell me what to do ?

in link below, i've prepared a sample code in c# that explains
everything.

http://www.vdadashzadeh.com/temp/panels.zip
 
S

Steve B.

First draw the whole picture to a bitmap object (using Graphics.FromImage)
and finally, write the bitmap to the panel.

You should also override the OnPaintBackground method of the panel, since it
will fill the control with the SystemColor.Control.


HTH
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top