problems moving a image around the screen

I have wrote a program to move a image from the bottom left hand corner of the screen, right, top, left and back to the starting position. I can get it to go right, but it then goes left again and stops. I know it is something to do with the > and< and speed, but I seem to not be able to get it in the right order.  


Option Explicit

Private Sub cmdExit_Click()
End
End Sub

Private Sub cmdGo_Click()
Do
imgCar.Left = imgCar.Left + txtSpeed.Text
Loop Until imgCar.Left > 10000
Do
imgCar.Top = imgCar.Top - txtSpeed.Text
Loop Until imgCar.Top > 2000

Do
imgCar.Left = imgCar.Left - txtSpeed.Text
Loop Until imgCar.Left < 1000

Do
imgCar.Top = imgCar.Top - txtSpeed.Text
Loop Until imgCar.Top > 1680


End Sub

Private Sub cmdStart_Click()


lblPrompt.Caption = "Enter Speed then press Go"
'here the speed box appears for the first time
'and the above text appears after the next statement
txtSpeed.Visible = True
txtSpeed.Text = "0"
cmdGo.Enabled = False
'move the pointer into the speed setting box
txtSpeed.SetFocus

End Sub

Private Sub txtSpeed_Change()
cmdGo.Enabled = True
End Sub
GsmithAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LischkeCommented:
The sub routine should look so:

Private Sub cmdGo_Click()
Do
imgCar.Left = imgCar.Left + txtSpeed.Text
Loop Until imgCar.Left >= 1024
Do
imgCar.Top = imgCar.Top - txtSpeed.Text
Loop Until imgCar.Top <= 0

Do
imgCar.Left = imgCar.Left - txtSpeed.Text
Loop Until imgCar.Left <= 0

Do
imgCar.Top = imgCar.Top + txtSpeed.Text
Loop Until imgCar.Top >= 768


End Sub

Note: I have changed the comparation values to a screen resolution of 1024 x 768 and assume the starting point is the lower left corner (x = 0; y = 768)

Ciao, Mike
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kretzschmarCommented:
uuh mike,
du bist ein vb'ler?
0
LischkeCommented:
:-) Ne, glaub's bloss nicht. Ich weiss nicht mal wie VB aussieht, aber vor langer Zeit habe ich mal mit Basic angefangen und was ein richtiger Programmierer ist, der wird doch wohl noch so'n Furzprogramm entlausen koennen :-)

Ciao, Mike
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

kretzschmarCommented:
:-)) ha ha,
das hast du ja auch geschafft
0
LischkeCommented:
Not sure about this as Gsmith never replied to my suggestion...

Again such a case we talked about lately...?

Ciao, Mike
0
GsmithAuthor Commented:
I have already accepted a answer and have completed the program I now understand what has to be changed. I am now trying another program from the book Into visual Basics. Thank anyway
0
LischkeCommented:
Aaah, there he is. Gsmith, I'm pleased that you solved the problem, but you should also spend attention to help you get/got for your questions. My proposed answer here dates from 2. November. You could have accepted or rejected it already a while ago. Keep in mind I (and the other experts) doing help for free!

Ciao, Mike
0
GsmithAuthor Commented:
Lets start at the beginning ! I am a she not a he. I did accept an answer from another expert on Visual Basics questions. I did delete this question on programming question page.
0
LischkeCommented:
Oh, you are the second girl I meet at E-E. Happens not very often... Perhaps you should sign your comments with your first name so one can see what gender you are :-) (although, it doesn't matter very much).

What I wonder about is that you deleted this question and it is still there. Unfortunately, such things happen from time to time here. Please go to the Customer Support Area and ask for deletion of this question, so you'll get back your points and there's no "ghost" flying around...

Ciao, Mike
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.