vb help, again
Results 1 to 3 of 3

Thread: vb help, again

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    72

    vb help, again

    sorry for my extensive asking for help about vb...but..........i am trying to make a SMALL rpg like game....for the movement of the character i use:

    If KeyCode = vbKeyD Then Image1.Left = Image1.Left + 25
    If KeyCode = vbKeyA Then Image1.Left = Image1.Left - 25
    If KeyCode = vbKeyW Then Image1.Top = Image1.Top - 25
    If KeyCode = vbKeyS Then Image1.Top = Image1.Top + 25

    is there any other way that is more proficient to do this? also, what i really want to be answered is that when i put a label and a command button onto the form, the movement doesnt work.....i figure its because the command button is shortcuted(ie, has the gray little line around it where if i just press space it executes)...is there any way to fix this? thanks!
    http://www.outwar.com/page.php?x=812668

    i brake for flipper babies

  2. #2
    Member
    Join Date
    Feb 2003
    Posts
    79
    Is the KeyPreview property of your form set to True? If not it should be. Where do you have that code? BTW, I may have already responded to one of your other question with this same suggestion, but a much better place to ask questions about VB is the VB Forums.
    - Runner -

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    72
    the code is in: Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) and setting the form property keypreview to true made it work! thanks a lot!!! and thanks for the link
    http://www.outwar.com/page.php?x=812668

    i brake for flipper babies

Posting Permissions

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