Sunday, May 11, 2014

VB auto Scrollbar move with timer

Public Class Form1
    Shared _timer As Timer
    Shared _list As List(Of String) = New List(Of String)

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
       
        '   HScrollBar1.Value = 50 + Label2.Text




    End Sub

    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        Label1.Text = TimeOfDay()
        Label2.Text = Now.Second

        HScrollBar1.Value = Label2.Text
       
    End Sub


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

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

   
End Class

No comments: