Click here to Skip to main content
15,891,739 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
there has a Chart,with some series.i use leftbutton of mouse to drag a rectangle.I use Graphics of GID+ to draw it ,but everytime I have to clear the entire drawing surface,it just like drawing board of win os. when i draw another rectanle,i save rectangles before and repaint.it flicks .
Posted
Updated 12-Oct-11 22:23pm
v2
Comments
Mehdi Gholam 13-Oct-11 4:24am    
EDIT -> removed bold

1 solution

There are a couple of ways to avoid this, but they depend on where you are doing the drawing. Are you using the Paint event? If not, why not? It even provides you with the required Graphics object!

If you are using the paint event, then try setting the DoubleBuffered property of the container you are drawing on (form, panel, or whatever) to true - that will probably get rid of the flicker.
 
Share this answer
 
Comments
BobJanova 13-Oct-11 6:32am    
We have a winner – custom graphics should be done in Paint, generally. If you need an immediate update, call Invalidate or Refresh.
tokenian 13-Oct-11 21:24pm    
I have tried those ways upstairs,but it didn't work.I'm a newer to WinForm,I'll try again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900