Text Scrolling Up Effect using VB.NET

Submitted by: 
Visitors have accessed this post 1520 times.

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 Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]

Add and Follow me on Facebook: https://www.facebook.com/donzzsky

Visit and like my page on Facebook at: https://www.facebook.com/BermzISware


Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.