Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Cant Disable Right Window Logo Key

Cant Disable Right Window Logo Key

Scheduled Pinned Locked Moved Visual Basic
help
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ghost181
    wrote on last edited by
    #1

    Hi, i cant disable the right window logo keys when i run my application. i use the following code to disable the window logo keys, but it just can disable left window logo key. private sub Textbox1_KeyDown(Byval sender as object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Textbox1.KeyDown if e.keycode=keys.LWin and e.keycode=Keys.RWin then e.handled=true end if end sub Pls Help me...:(

    D 1 Reply Last reply
    0
    • G ghost181

      Hi, i cant disable the right window logo keys when i run my application. i use the following code to disable the window logo keys, but it just can disable left window logo key. private sub Textbox1_KeyDown(Byval sender as object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Textbox1.KeyDown if e.keycode=keys.LWin and e.keycode=Keys.RWin then e.handled=true end if end sub Pls Help me...:(

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      How about changing your If statement to 'OR':

      If e.KeyCode=Keys.LWin Or e.KeyCode=Keys.RWin Then

      Dave Kreskowiak Microsoft MVP - Visual Basic

      G 1 Reply Last reply
      0
      • D Dave Kreskowiak

        How about changing your If statement to 'OR':

        If e.KeyCode=Keys.LWin Or e.KeyCode=Keys.RWin Then

        Dave Kreskowiak Microsoft MVP - Visual Basic

        G Offline
        G Offline
        ghost181
        wrote on last edited by
        #3

        still cannot disable the right window logo key. If e.KeyCode=Keys.RWin Then code here also just allow me to disable the left window logo key.

        D 1 Reply Last reply
        0
        • G ghost181

          still cannot disable the right window logo key. If e.KeyCode=Keys.RWin Then code here also just allow me to disable the left window logo key.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You might want to set a breakpoint on that If statement and see if its even being called when you hit that key. If it is, then you can peek at the e.KeyCode to see what value it holds. Then you can change the code to look for that value. Be warned! Not every keyboard has 2 Windows logo keys.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups