Clear problem

06-27-2006, 01:52 PM

I have a picture box which i am drawing on. Here's the code i am using:

Private sub timer_tick


for i = 1 to 999
Picture1.creategraphics.drawstring( i ,font, , i * 25 - SCROLLBAR.value , 0 )
next i

End sub

The problem is when the screen clears white, you can see flashes of white.

Is there anyway to fix this? i remember it never done this in vb6.

Any help would be great thanks!

P.S:The code might not be EXACLY right, becuase i am not at at the moment. but you should be able to understand it.

06-28-2006, 10:02 AM
The flashing is most likely a result of all the overhead you've got going there. Every time that timer ticks, you're calling CreateGraphics about 1000 times. So I recommend 2 things: 1) write a better organized (and more proper) sub (check out this site for info on better ways to do this stuff: and 2) learn about double buffering.

06-28-2006, 11:48 AM
This never happened in vb6 and i used toput it throught more than 8000 drawing function :huh:

06-28-2006, 05:13 PM
Well, you can get performance similar to VB6 out of .Net-- just not the way you're doing it. The suggestions in my earlier post will help you find the proper way of doing things.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum