Tools Links Login

A easy Scroll with 1 line of code

Scroll a label with just one line of code...great for showing credits!!!!

Original Author: Steve Williams

Inputs

You will need a timer and set the interval to 1
and of course a label with whatever you want to say. In this example position the label toward the bottom of the form

Assumptions

Put this in your timer event
Bottom to Top Scroll
1) Use the move method; label1.Move
2) Keep the labels Left property the same;
label1.move label1.left
3) Move it by subtracting from the top
label1.Move label1.Left, label1.Top - 10
Thats it...It don't get any easier than this!
For a faster scroll just subtract more from the top;
ie: label1.Move label1.Left, label1.Top - 50
Side Scroll "Marquee"
label1.Move label1.Left - 10
The Top is optional as well as the Width and Height

Side Effects

It will give the same amount of flicker as the others do but why write all that code to do the same purpose?

Code

Private Sub Timer1_Timer()
  Label1.Move Label1.Left, Label1.Top - 10
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 89 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.