Post by Izy Coder on Oct 18, 2014 4:48:53 GMT 10
Scrolling Text
Do you want to make scrolling text? This trick will show you how! How to make scrolling text, the simple way! Only 9 steps (not 10). - Add a Label, 2 buttons and a Timer.
- Set Button 1 text = "Start".
- Set Button 2 text = "Stop".
- Set Timer 1, Enabled = True .
- Double click form 1 then enter this code :
Timer1.Stop() - Double click Button1 then enter this code :
Timer1.Start() - Double click Button2 then enter this code :
Timer1.Stop() - Double click Timer 1 then enter this code :
Label1.Location -= New Point(-100, 0) If Label1.Location.X > 445 Then Label1.Location = New Point(-300, 9) End If - Done ! Click Debug !
Do You Want To Edit It?
Timer1.Start() | Starts Timer1.
| Timer1.Stop() | Stops Timer1 (must start Timer1 first).
|
Label1.Location -= New Point(-100, 0) | The label1 location, It will move to right with 100 speed, to change the speed, find (-100, 0) and change it like (-20, 0) to 20 speed.
| If Label1.Location.X > 445 Then | Check if label1 location/position of X is bigger than 445, then it will do the next function. ">" symbol is bigger than. "<" symbol is smaller than. If your form size is bigger than 445, then change 445 to something else. Must bigger than your form like if your form X size is 600, change to 620 or bigger.
| Label1.Location = New Point(-300, 9) | Label1 location at (-300, 9). If your text scrolls to the right, only change -300. Don't change 9. If not, you can edit whatever you want. This will move your label1 to the given location (-300, 9). You can change this location to whatever you want. | End If | End the If Label1.Location.X > 445 Then. This will do nothing but it will give an error if you miss this code.
|
Notes :- If you want the label to keep scrolling, don't use the Timer1.Stop() code.
- To make it scroll to the left, you can change it in the code :
Label1.Location -= New Point(-100, 0) - This doesn't only work with Labels but with other controls too!
Not Working?
Does the code not work? Works with :VB 2010 Professional/Express Still Not working, try this :- Please read carefully! Don't miss any steps!
- Please make a new project!
- You can download the demo here. (link not work, will update soon)
Please Like And Comment ! I didn't learn any tutorial for this, I made it myself, simple right?
Check Out My Project At VSlang InternetTM. More Project : - Poroxnoss Text Editor 2 - Added soon...
- TAP 2D Game Maker - Coming really soon...
- Easy Desktop - Discontinue..
|
|