![]() |
how to move a vb label across the screen and then back again
hi all i need a little help, i am working on a project and i need to make a label move accross the screen and back again once it come to the end of the open form.
any help on this would be appriciated a dudley |
Hey, you can invent the marquee, then maybe the BLINK tag :D .
|
what i have to do is try to use cos and sin to make this thing work, so all i am after is the basoc raw code so i can manipulate it
any help is always appriciated a dudley |
use a clock or timer i cant remember exactly what its called but then use something like this
:
Label1.Left = Clock1.whatever the increment is called |
Crawford's almost there - you need to alter the Left property of the Label. Create a Timer control, set the interval to something low (like 10 - it's measured in milliseconds), double-click on it, and put this in:
:
Label1.Left = Label1.Left - 1You'll also need to move the label when it goes off the screen - I'll let you figure that one out. |
Its been a while since I've used visual basic (1 yr to be exact).
|
no disrepect but thats really helpful
|
Quote:
|
You mentioned Sine so I guess you're trying to achieve a smooth bounce effect or similar. May I suggest you use the GDI APIs or DirectDraw, as even with double buffering (AutoRedraw), the native VB graphical methods won't get you a decent enough refresh rate.
|
if you're just going with a simple approach to this, just check to see when the furthest left pixel of your object you are scrolling hits the right edge of the window and then send it back to the starting point again.
|
| All times are GMT -5. The time now is 11:16 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC