![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2005
Posts: 3
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Hey, you can invent the marquee, then maybe the BLINK tag
.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Nov 2005
Posts: 3
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#4 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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 - 1 You'll also need to move the label when it goes off the screen - I'll let you figure that one out. |
|
|
|
|
|
#6 |
|
Expert Programmer
|
Its been a while since I've used visual basic (1 yr to be exact).
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: Nov 2005
Posts: 3
Rep Power: 0
![]() |
no disrepect but thats really helpful
|
|
|
|
|
|
#8 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#9 |
|
Expert Programmer
|
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.
|
|
|
|
|
|
#10 |
|
Hobbyist Programmer
|
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.
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|