Results 1 to 2 of 2

Thread: Window KeyDown

  1. #1
    Addicted Member
    Join Date
    Oct 10
    Posts
    191

    Window KeyDown

    Hello! In the KeyDown event of the MainWindow, i want a message box to appear when the users presses the +/- on the keyboard. So here is my code:

    if e.KeyCode = Keys.OEMPlus then MsgBox("Plus")
    if e.KeyCode = Keys.OEMMinus then Msgbox("Minus")

    This code works great but not for the +/- from numpad too. It only works with +/- on the main keyboard. How can i make both work?

  2. #2
    Frenzied Member
    Join Date
    Sep 06
    Posts
    1,259

    Re: Window KeyDown

    Code:
            If e.KeyCode = Keys.Oemplus OrElse e.KeyCode = Keys.Add Then MsgBox("Plus")
            If e.KeyCode = Keys.OemMinus OrElse e.KeyCode = Keys.Subtract Then MsgBox("Minus")

Posting Permissions

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