1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

VB Problem

  1. Oct 16, 2007 #1
    Just have to get a picture box to move around a screen, I'm running the program by a timer. I'll show set integers below.

    Timer = Timer1
    Picture Box = Robot
    Dim Robotpace as integer


    Basically, when you click on the start button it enables the timer. Here's the coding.



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

    RobotPace = 8
    Robot.Left -= RobotPace
    If Robot.Left <= 1 Then
    Robot.Left = False
    Robot.Top -= RobotPace
    If Robot.Top <= 1 Then
    Robot.Top = False
    + Robot.Left += RobotPace
    + If Robot.Left <= 1 Then
    + Robot.Left = False


    End If
    End If

    End Sub



    The lines with the (+'s) at the start of them are the begining of the error. At this point, I'm aware that the timer mistakes the + and - statements in the Robot.Left movements and it completely glitches.

    I just can't fix this.
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted



Similar Discussions: VB Problem
  1. VB code question (Replies: 4)

  2. Help with VB (Replies: 1)

Loading...