Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

problem with image box

Question posted by: vbbeginner (Newbie) on June 27th, 2008 10:23 PM
Hi
when i tried to move an image box by a timer, it moved but with flashing
what can i do?
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
leeogrady's Avatar
leeogrady
Newbie
10 Posts
June 28th, 2008
03:21 AM
#2

Re: problem with image box
More information would be helpful to assist you, the section of the code maybe?
All i can assume from what you have posted is that the image box is flashing as the timer ticks, this would be normal as it is redrawing itself... If you give me an idea of what you are trying to do, and or a code segment, i may be able to assist further..

Lee

Reply
vbbeginner's Avatar
vbbeginner
Newbie
6 Posts
July 3rd, 2008
12:17 PM
#3

Re: problem with image box
More information would be helpful to assist you, the section of the code maybe?
All i can assume from what you have posted is that the image box is flashing as the timer ticks, this would be normal as it is redrawing itself... If you give me an idea of what you are trying to do, and or a code segment, i may be able to assist further..

Lee

Thanks for your help
and this is the code i use to move the image

Private Sub Timer1_Timer()
image1.Left=image1.Left+50
End Sub

the property of interval of the timer is 100

Reply
leeogrady's Avatar
leeogrady
Newbie
10 Posts
July 4th, 2008
03:54 AM
#4

Re: problem with image box
Hi, i have just written your code into a test app, an it doesnt appear to 'flash' in theory, i guess it could be your computer running slow? as the image will disappear, then re-appear in the new position...
Depending on what you are trying to do you could reduce the 'step' of moving (the imag1.left +50) to a smaller value an the timer tick, this may make the movement smoother and appear not to flash.. (just out of curiosity, may not have anything to do with it, do you have a CRT monitor? sometimes the refresh rate may cause this sort of thing to appear to flash..)

Sorry i cant give you a definite answer, but hope this helps!
Lee

Reply
debasisdas's Avatar
debasisdas
Moderator
6,448 Posts
July 4th, 2008
04:23 AM
#5

Re: problem with image box
Please try to use Form_Paint() event , that might help.

Reply
Reply
Not the answer you were looking for? Post your question . . .
182,541 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top Visual Basic Forum Contributors