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. C#
  4. How can i make shortcut keys by using code

How can i make shortcut keys by using code

Scheduled Pinned Locked Moved C#
helpquestion
3 Posts 3 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.
  • I Offline
    I Offline
    inayat basha
    wrote on last edited by
    #1

    how can i make shortcut keys in code for examole if i press F1 then some page has to redirect or open. can any one help me plzzz Regards, S.Inayat Basha.

    R L 2 Replies Last reply
    0
    • I inayat basha

      how can i make shortcut keys in code for examole if i press F1 then some page has to redirect or open. can any one help me plzzz Regards, S.Inayat Basha.

      R Offline
      R Offline
      robbrad
      wrote on last edited by
      #2

      http://www.devasp.net/net/articles/display/728.html[^] Edit: This shows you how to map keys to certain buttons (Not tested).

      modified on Monday, December 21, 2009 11:21 AM

      1 Reply Last reply
      0
      • I inayat basha

        how can i make shortcut keys in code for examole if i press F1 then some page has to redirect or open. can any one help me plzzz Regards, S.Inayat Basha.

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

        Hi, there are two ways: 1. the easy one: give your Form a MainMenu or MenuStrip and make sure the actions you want are present in the menus; all it takes to create shortcuts is setting their corresponding ShortCut property. 2. the harder way (also for the user as he has no clue what shortcuts are available): let your Form preview the keyboard (Form.KeyPreview) and give it a KeyDown handler. No need to process the keys for each individual Control on the form! :)

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


        I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


        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