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

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
 
S

Steve Barnett

Shot in the dark, but have you tried adding this to the top of the Paint
method:

this.DoubleBuffered = true;

Might help.

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