> This is source code of my testing program:
> http://www.teleeye.com/marketing/Software/PlaybackLogCtrl_sample.zip
Please don't post links to your code. Post an actual code sample with
your post.
And please don't just copy and paste whatever code you have. Post a
concise-but-complete sample of code. "Concise" means you have removed
_everything_ from the code that is not absolutely required in order to
reproduce the problem. "Complete" means there is _nothing_ left out of
the code that is needed in order to compile and run it.
That said, you may not need to fix that mistake. Specifically...
> In the source, i used a tableLayout Named logCamTableLayout and put
> many logCamPanel on them, and then draw a Line on each of the
> logCamPanel, and when these logCamPanel is redraw, it will call
> OnPaint, and i will write a line that, but i find the screen will be
> flicking when it needs to redraw. Does anyone know how to solve it?
It sounds to me as though the problem you're concerned about is simply
the visual effect of the control erasing its background and then you
drawing the line again. This makes the line seem to flicker.
You can usually solve this easily simply by setting the DoubleBuffered
property of the control to "true". Note that to do this, you have to
have your own class derived (at some point) from Control. IMHO, if you
want to do custom drawing, this is a better way anyway. So make a new
class, derived from Panel, and in the constructor set the DoubleBuffered
property to "true. Then instead of subscribing to the Paint event, just
override the OnPaint() method in the class.
Pete
linuxfedora@yahoo.com.hk - 05 Oct 2007 10:05 GMT
Sorry, i have removed most of the code from the original source before
posting.
Okey, thank, then i should search for document on doublebuffering and
try to use a custom panel to draw the line. THanks