Results 1 to 4 of 4

Thread: NEVER MIND FOUND OUT

  1. #1
    ¿?NotoriouS?¿
    Guest

    Arrow NEVER MIND FOUND OUT

    okay as you people might know in order to move a image box left you minus 100 of the left well how come this doesn't work?
    Private Sub Form_KeyPress(KeyAscii As Integer)

    If KeyAscii = 52 And step = 1 And thrand.Left < Image1.Left And thrand.Left + thrand.Width < osweet.Left Then
    thrand.Left = Val(thrand.Left) - Val(a)
    thrand.Picture = Form3.lefta.Picture
    End If
    If KeyAscii = 54 And step = 1 And thrand.Left + thrand.Width < osweet.Left Then
    thrand.Left = Val(thrand.Left) + Val(a)
    thrand.Picture = Form3.right.Picture
    End If
    If step = 1 And KeyAscii = 56 And thrand.Top <= Image1.Top Then
    thrand.Move thrand.Top + 100
    thrand.Picture = Form3.up.Picture
    End If

    End Sub

    moving right works though

  2. #2
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423
    What R U Trying To Do? Get A Image To Move Around?

    What Is Thrand?

    What Is osweet?

  3. #3
    ¿?NotoriouS?¿
    Guest
    read the book called dream carvers by joan clark

  4. #4
    Hyperactive Member ZeroCool's Avatar
    Join Date
    Feb 2002
    Location
    In front of my computer
    Posts
    423
    Try This:

    VB Code:
    1. Private Sub Form_KeyDown(Keycode As Integer, Shift As Integer)
    2. Call MoveObject(Image1, Keycode)
    3. End Sub
    4.  
    5. Private Function MoveObject(Object As Object, Keycode As Integer)
    6. Select Case Keycode
    7. Case vbKeyUp
    8. If Object.Top < 0 Then: Object.Top = Me.Height
    9. Object.Top = Object.Top - 100
    10. Exit Function
    11. Case vbKeyDown
    12. If Object.Top > Me.Height Then: Object.Top = 0
    13. Object.Top = Object.Top + 100
    14. Exit Function
    15. Case vbKeyRight
    16. If Object.Left > Me.Width Then: Object.Left = 0
    17. Object.Left = Object.Left + 100
    18. Exit Function
    19. Case vbKeyLeft
    20. If Object.Left < 0 Then: Object.Left = Me.Width
    21. Object.Left = Object.Left - 100
    22. Exit Function
    23. End Select
    24. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width