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. Recognize Multiple keys being pressed

Recognize Multiple keys being pressed

Scheduled Pinned Locked Moved Visual Basic
csharpgame-devhelp
2 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.
  • P Offline
    P Offline
    Pugman812
    wrote on last edited by
    #1

    I just want to start by saying that i have been out of the programming game for a while and i just started to do a little work on a old project of mine. All i want to do is be make a listbox recognize when more than one key is pressed. To be exact, i want ctrl+A to do a select all in the listbox. I figure that .NET has something that i do not know about that is builtin to make this task easy. Thank you for a help that is provided.

    L 1 Reply Last reply
    0
    • P Pugman812

      I just want to start by saying that i have been out of the programming game for a while and i just started to do a little work on a old project of mine. All i want to do is be make a listbox recognize when more than one key is pressed. To be exact, i want ctrl+A to do a select all in the listbox. I figure that .NET has something that i do not know about that is builtin to make this task easy. Thank you for a help that is provided.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      there are two easy ways to get that: 1. provide a MainMenu and some Menu Item that allows the user to do whatever it is you want the shortcut to do too. Then set the shortcut for that Menu Item. Done. 2. Set Form.KeyPreview true, provide a Form.KeyDown handler that checks for KeyEventArgs.Control And KeyEventArgs.KeyCode=Keys.A BTW: you can always get the instantaneous state of the modifier keys from Control.ModifierKeys :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.


      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