Results 1 to 2 of 2

Thread: Window KeyDown

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2010
    Posts
    195

    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
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    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
  •  



Click Here to Expand Forum to Full Width