Text Scrolling Up Effect using VB.NET

In this article, we will create a program that has an effect of scrolling up the text. Now, let's start this tutorial! 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application. 2. Next, add only one Label named Label1 and labeled it as any text. Add a timer control named Timer1 and have its interval of 30. You must design your interface like this: design 3. Now put this code for your code module. This code is for Timer1_Tick and it will have to be enabled in the Form_Load:
  1.  Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2.         If Label1.Top = -Label1.Height Then
  3.             Label1.Top = Label1.Height
  4.         Else
  5.             Label1.Top =  Label1.Top - 1
  6.         End If
  7.     End Sub
  8.  
  9.  
  10.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  11.         Timer1.Enabled = True
  12.     End Sub

Explanation:

We have created a code for Timer1 when ticking its clock or starting its time. This event occurs when the specified timer interval has elapsed and the timer is enabled. We have created an If Else statement for the top and height of the Label. If the top will be equal to the negative of its height then it will be equal on both positive location of the top and its height. Meaning to say, after it will going up and bounds with the form, it will back to its original place and will scroll up again. If not yet, then the label top position will be decremented by 1. Why it must be decremented? Because minimizing or lowering the value of the top position will have a greater top position. When it will be incremented, then it will scroll down at the bottom. Then, in loading the form, we just have enabled the time do that the first run of the program it will scroll up the text in our label.

Output:

output Download the source code below and try it! :) For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards,

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]

Visit and like my page on Facebook at: Bermz ISware Solutions

Subscribe at my YouTube Channel at: SerBermz

Add new comment