Results 1 to 5 of 5

Thread: [2005][Resolved] trouble with keys.oem(number)

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2008
    Posts
    95

    Resolved [2005][Resolved] trouble with keys.oem(number)

    I'm having trouble getting vb to recognize that a number key across the top of the keyboard is being pressed. I think that those keys are Oem1-9.
    this is my code:
    vb Code:
    1. Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
    2.         Select Case e.KeyCode
    3.             Case Is = Keys.A
    4.                 Pic1Move3.Enabled = False
    5.             Case Is = Keys.S
    6.                 Pic1Move2.Enabled = False
    7.             Case Is = Keys.D
    8.                 Pic1Move1.Enabled = False
    9.             Case Is = Keys.W
    10.                 Pic1Move0.Enabled = False
    11.             Case Is = Keys.Up
    12.                 Pic2Move0.Enabled = False
    13.             Case Is = Keys.Right
    14.                 Pic2Move1.Enabled = False
    15.             Case Is = Keys.Down
    16.                 Pic2Move2.Enabled = False
    17.             Case Is = Keys.Left
    18.                 Pic2Move3.Enabled = False
    19.             Case Is = Keys.Oem1
    20.                 Select Case P1Spells(1)
    21.                     Case Is = "Fireball"
    22.                         P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png")
    23.                 End Select
    24.             Case Is = Keys.Oem2
    25.                 Select Case P1Spells(2)
    26.                     Case Is = "Fireball"
    27.                         P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png")
    28.                 End Select
    29.             Case Is = Keys.Oem3
    30.                 Select Case P1Spells(3)
    31.                     Case Is = "Fireball"
    32.                         P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png")
    33.                 End Select
    34.             Case Is = Keys.Oem4
    35.                 Select Case P1Spells(4)
    36.                     Case Is = "Fireball"
    37.                         P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png")
    38.                 End Select
    39.             Case Is = Keys.Oem5
    40.                 Select Case P1Spells(5)
    41.                     Case Is = "Fireball"
    42.                         P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png")
    43.                 End Select
    44.             Case Is = Keys.Q
    45.                 P1CurrentSpell.BackgroundImage = Nothing
    46.         End Select
    47.     End Sub

    the code works if i use any other key (like the numpad), just not with Oem. It doesnt give me an error, it just does nothing when i press the number keys.
    anyone got a reason why?

    Thanks.
    Last edited by squrrilslayer; Apr 12th, 2008 at 02:48 AM.

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