Results 1 to 5 of 5

Thread: What's up with that??

  1. #1
    Hyperactive Member rEaL iGoR's Avatar
    Join Date
    Apr 01
    Location
    A secret!
    Posts
    417

    Angry What's up with that??

    I'm sort of confused by something which really bothers me a lot. I've written a tiny game. Not yet complete, but it's under construction. Nevertheless, I've used a timer to control the events:

    Code:
    Public Sub Form_Keypress(KeyCode as Blabla)
    Select KeyCode
        Case vbKeyUp
        Boy.Tag = "Up"
    End Select
    End Sub
    
    Public Sub Time_Timer()
    :)If Boy.Tag = "Up" Then Boy.Top = Boy.Top - 120
    End Sub
    This is, of course, an incredibly simple adaption of my code. However,
    Somewhere in the code, it gets stuck, and my 'boy' won't move. But, if
    I insert a breakpoint where I've left a , and the program breaks,
    I remove the breakpoint and continue the program, the boy moves. What's up with that?

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 00
    Location
    Heiho no michi
    Posts
    1,827
    Maybe it's moving it, but the window isn't refreshing. So although things have moved, you can't see the change.

    It's just a guess.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Hyperactive Member rEaL iGoR's Avatar
    Join Date
    Apr 01
    Location
    A secret!
    Posts
    417

    hmm

    I don't know. At all. It happened once before, and seemed like it solved itself, cause suddenly it just started working again. In any case, how do I fix it?

  4. #4
    Hyperactive Member rEaL iGoR's Avatar
    Join Date
    Apr 01
    Location
    A secret!
    Posts
    417

    YES!

    I know what's the problem. However, I don't really know how to fix it. It's just that I have a command button on the form and it's the first thing to get focus. However when I use the breakpoint, the form recieves the focus, and my boy is ready to move. How do I make the command button to not recieve focus.

    I've already set Command1.TabStop = False

    In advance, Thank You

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 00
    Location
    Heiho no michi
    Posts
    1,827
    Have you set the form's KeyPreview property to True?
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

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