Write VB program that moves image left or right using click event.

Write VB program that moves image left or right using click event.

Private Sub CmdLeft_Click()

Label1 = Image1.Left

If Image1.Left <= 0 Then

    Image1.Left = 0

Else

    Image1.Left = Image1.Left - 5

End If

End Sub

 

Private Sub CmdRight_Click()

Label1 = Image1.Left

If Image1.Left >= 5000 Then

    Image1.Left = 5000

Else

    Image1.Left = Image1.Left + 500

End If

 

End Sub


Comments