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

  • Thread starter Thread starter vahid.xplod
  • Start date Start date
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
 
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
 
Back
Top