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

  • Thread starter Thread starter Vahid Dadashzadeh
  • Start date Start date
V

Vahid Dadashzadeh

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
 
Shot in the dark, but have you tried adding this to the top of the Paint
method:

this.DoubleBuffered = true;

Might help.

Steve
 
Back
Top