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:
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp Select Case e.KeyCode Case Is = Keys.A Pic1Move3.Enabled = False Case Is = Keys.S Pic1Move2.Enabled = False Case Is = Keys.D Pic1Move1.Enabled = False Case Is = Keys.W Pic1Move0.Enabled = False Case Is = Keys.Up Pic2Move0.Enabled = False Case Is = Keys.Right Pic2Move1.Enabled = False Case Is = Keys.Down Pic2Move2.Enabled = False Case Is = Keys.Left Pic2Move3.Enabled = False Case Is = Keys.Oem1 Select Case P1Spells(1) Case Is = "Fireball" P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png") End Select Case Is = Keys.Oem2 Select Case P1Spells(2) Case Is = "Fireball" P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png") End Select Case Is = Keys.Oem3 Select Case P1Spells(3) Case Is = "Fireball" P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png") End Select Case Is = Keys.Oem4 Select Case P1Spells(4) Case Is = "Fireball" P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png") End Select Case Is = Keys.Oem5 Select Case P1Spells(5) Case Is = "Fireball" P1CurrentSpell.BackgroundImage = Image.FromFile("Fireball Icon.png") End Select Case Is = Keys.Q P1CurrentSpell.BackgroundImage = Nothing End Select 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.




Reply With Quote