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. Ctrl+S Implemention

Ctrl+S Implemention

Scheduled Pinned Locked Moved C#
9 Posts 4 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.
  • H Offline
    H Offline
    half life
    wrote on last edited by
    #1

    Hi, i'm Trying to Implement the Ctrl+S (save) Do i need to Monitor the KeyPress Events and check The Last Two Keys Pressed or there is an easer way ( a Buit -In ) :)

    Have Fun Never forget it

    S J P 3 Replies Last reply
    0
    • H half life

      Hi, i'm Trying to Implement the Ctrl+S (save) Do i need to Monitor the KeyPress Events and check The Last Two Keys Pressed or there is an easer way ( a Buit -In ) :)

      Have Fun Never forget it

      S Offline
      S Offline
      see_seA
      wrote on last edited by
      #2
         private void form\_KeyDown(object sender, KeyEventArgs e)
          {
              // shortcuts
              if (e.Control && e.KeyCode == Keys.S)
                  // do action
      
      H 1 Reply Last reply
      0
      • H half life

        Hi, i'm Trying to Implement the Ctrl+S (save) Do i need to Monitor the KeyPress Events and check The Last Two Keys Pressed or there is an easer way ( a Buit -In ) :)

        Have Fun Never forget it

        J Offline
        J Offline
        jamie550
        wrote on last edited by
        #3

        KeyUp's (or KeyDown's) KeyEventArgs has a Control property, then just check KeyCode for S.

        1 Reply Last reply
        0
        • H half life

          Hi, i'm Trying to Implement the Ctrl+S (save) Do i need to Monitor the KeyPress Events and check The Last Two Keys Pressed or there is an easer way ( a Buit -In ) :)

          Have Fun Never forget it

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          If you have a menu on the form, just set the shortcut to Ctrl+S on your Save item.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          H 2 Replies Last reply
          0
          • S see_seA
               private void form\_KeyDown(object sender, KeyEventArgs e)
                {
                    // shortcuts
                    if (e.Control && e.KeyCode == Keys.S)
                        // do action
            
            H Offline
            H Offline
            half life
            wrote on last edited by
            #5

            Thanks a Lot :)

            Have Fun Never forget it

            1 Reply Last reply
            0
            • P Pete OHanlon

              If you have a menu on the form, just set the shortcut to Ctrl+S on your Save item.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              H Offline
              H Offline
              half life
              wrote on last edited by
              #6

              Wow, Thanks A lot i Never Knew this Feature Exsits Thanks Agian :)

              Have Fun Never forget it

              1 Reply Last reply
              0
              • P Pete OHanlon

                If you have a menu on the form, just set the shortcut to Ctrl+S on your Save item.

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                H Offline
                H Offline
                half life
                wrote on last edited by
                #7

                I What some UserControl each with a Menu the Funny thing is that it always selects the last and perform the Action on it any IDEA :)

                Have Fun Never forget it

                P 1 Reply Last reply
                0
                • H half life

                  I What some UserControl each with a Menu the Funny thing is that it always selects the last and perform the Action on it any IDEA :)

                  Have Fun Never forget it

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  You can't have the same shortcut assigned to different actions. You need to supply a different shortcut.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  H 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    You can't have the same shortcut assigned to different actions. You need to supply a different shortcut.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    H Offline
                    H Offline
                    half life
                    wrote on last edited by
                    #9

                    Thanks :)

                    Have Fun Never forget it

                    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