** this is what i have so far, this should move to the top right corner, but it seems to be going on non-stop.
any help will be appreciated, if there was any inclarity please inform me, i will clarify.

**

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Timer1.Enabled = True
    End Sub
     Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        If Button1.Left = (Me.Width - Button1.Width) Then
            Timer1.Enabled = False
        Else
            Button1.Left += 10
            Button1.Top -= 10
        End If
    End Sub

Your problem is that your position is falling between the cracks. For example, if your x coordinates vary like 53, 63, 73, etc. and you are checking for an exact limit such as x = 100 to stop then your timer will not stop because you pass by 100 without equalling it. Try something like

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
    If Button1.Right >= Me.Width Or Button1.Top <= 0 Then
        Timer1.Enabled = False
    Else
        Button1.Left += 10
        Button1.Top -= 10
        Me.Text = Button1.Left & "," & Button1.Top
    End If
End Sub

Play with the exact nunmbers to get the button to stop right at the edge.

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.