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. Keys shortcuts problem

Keys shortcuts problem

Scheduled Pinned Locked Moved C#
helpquestion
7 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.
  • T Offline
    T Offline
    Tavbi
    wrote on last edited by
    #1

    Hi, I need to know how can I create shotcut to myButton on form when I press key F10 independent of current active control on form, without using "ShortcutKey" in "ToolStipMenuItem". I can do this if myButton is active control on form. I explicitly need to use key F10, so I can't use an & (ampersand) in a button text. Thanks for help

    L 1 Reply Last reply
    0
    • T Tavbi

      Hi, I need to know how can I create shotcut to myButton on form when I press key F10 independent of current active control on form, without using "ShortcutKey" in "ToolStipMenuItem". I can do this if myButton is active control on form. I explicitly need to use key F10, so I can't use an & (ampersand) in a button text. Thanks for help

      L Offline
      L Offline
      luckykhalid
      wrote on last edited by
      #2

      handle key down or key up event of the form and then trigger click event by; if(e.KeyCode == Keys.F10) button1.PerformClick(); hope it helps.

      Regards Khalid

      M 1 Reply Last reply
      0
      • L luckykhalid

        handle key down or key up event of the form and then trigger click event by; if(e.KeyCode == Keys.F10) button1.PerformClick(); hope it helps.

        Regards Khalid

        M Offline
        M Offline
        Martin 0
        wrote on last edited by
        #3

        Hello, And dont't forget to set: this.KeyPreview = true; All the best, Martin

        T 2 Replies Last reply
        0
        • M Martin 0

          Hello, And dont't forget to set: this.KeyPreview = true; All the best, Martin

          T Offline
          T Offline
          Tavbi
          wrote on last edited by
          #4

          Thanks both, it really works.

          1 Reply Last reply
          0
          • M Martin 0

            Hello, And dont't forget to set: this.KeyPreview = true; All the best, Martin

            T Offline
            T Offline
            Tavbi
            wrote on last edited by
            #5

            Hi, I have just one more question. Can I check if ALT+F1 pressed? Thanks, Jure

            M 1 Reply Last reply
            0
            • T Tavbi

              Hi, I have just one more question. Can I check if ALT+F1 pressed? Thanks, Jure

              M Offline
              M Offline
              Martin 0
              wrote on last edited by
              #6

              Hello, Yes you can! if (e.Alt && e.KeyCode == Keys.F1) Hope it's not too late, but I didn't got your post. All the best, Martin

              T 1 Reply Last reply
              0
              • M Martin 0

                Hello, Yes you can! if (e.Alt && e.KeyCode == Keys.F1) Hope it's not too late, but I didn't got your post. All the best, Martin

                T Offline
                T Offline
                Tavbi
                wrote on last edited by
                #7

                Thanks, it's not too late. Thanks again, Jure

                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