ARTICLE

Scroll text using timer in VB.NET

Posted by Satyapriya Nayak Articles | Windows Forms VB.NET August 08, 2011
Here I will show you how to scroll text message in both the directions from left to right and from right to left.
Download Files:
 
Reader Level:

Here I will show you how to scroll text message in both the directions from left to right and from right to left.


Program

Public Class Form1

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        Label1.Text = Mid(Label1.Text, Len(Label1.Text)) & Mid(Label1.Text, 1, Len(Label1.Text) - 1)

        Label1.ForeColor = Color.White

        Label1.BackColor = Color.Red

    End Sub

 

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        Label2.Text = Mid(Label2.Text, 2, Len(Label2.Text)) & Mid(Label2.Text, 1, 1)

        Label2.ForeColor = Color.White

        Label2.BackColor = Color.Red

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Timer1.Enabled = True

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Timer2.Enabled = True

    End Sub

End Class

Output

timer1.gif

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Nevron Diagram
Become a Sponsor