Static x As Integer = +TimeLbl.Left
        Static y As Integer = TimeLbl.Top
        Static width As Integer = TimeLbl.Width
        Static height As Integer = TimeLbl.Height

        If DateTime.Now = "08:00:00" Then
            Timer1.Enabled = True

            With Me
                x += 0.6
                If x <= +.TimeLbl.Width Then
                    x = .Width

                End If
                .TimeLbl.SetBounds(x, y, width, height)
            End With

        ElseIf DateTime.Now = "117:00:00" Then
            Timer1.Enabled = False
        End If

here i got problem when the codings above doesn't work to move the label to the right automatically when i assign specific time.

Hi;

I Don't know what is your Goal here

but, if it is just move the label then
dim x,y as static and add to them
like this:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static x, y
        Label1.SetBounds(x, y, Label1.Width, Label1.Height)
        x += 1
        y += 1
    End Sub

good luck;

the label already successfully move to the right.the problem now is i want to move it automatically.For example i want to move it automatically when the time is 8 am and stop at 5 pm.The algorithm should be like this : if time now= 8.00 am then timer.enabled = true.
I've tried this code but it's still couldn't work.

Static x As Integer = +TimeLbl.Left
        Static y As Integer = TimeLbl.Top
        Static width As Integer = TimeLbl.Width
        Static height As Integer = TimeLbl.Height

        If timeofday = "08:00:00" Then
            Timer1.Enabled = True

            With Me
                x += 0.6
                If x <= +.TimeLbl.Width Then
                    x = .Width

                End If
                .TimeLbl.SetBounds(x, y, width, height)
            End With

        ElseIf timeofday = "17:00:00" Then
            Timer1.Enabled = False
        End If

Hi;
if i understand well , then i think this well work

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static x, y
        Dim starttime As String
        Dim endtime As String
        starttime = #1:57:00 PM#
        endtime = #2:10:00 PM#
        If Now.ToLongTimeString >= starttime Then
            If Now.ToLongTimeString >= endtime Then
                Timer1.Stop()
                
            Else
                Timer1.Start()
                Label1.SetBounds(x, y, Label1.Width, Label1.Height)
                x += 1
                y += 1
            End If
        End If
        Me.Text = Now.ToLongTimeString
      
    End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.