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 to work with Shortcut & Keyboard

How to work with Shortcut & Keyboard

Scheduled Pinned Locked Moved C#
c++csharphelptutorial
6 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.
  • L Offline
    L Offline
    Laji59
    wrote on last edited by
    #1

    If you know we have a thing that is named Accelerator in Visual C++ for working with shortcut and keyboard do we have any things like this in C#. if no; Please help me to impelement like this

    Hello Friends

    L P 2 Replies Last reply
    0
    • L Laji59

      If you know we have a thing that is named Accelerator in Visual C++ for working with shortcut and keyboard do we have any things like this in C#. if no; Please help me to impelement like this

      Hello Friends

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Laji59 wrote:

      If you know we have a thing that is named Accelerator in Visual C++ for working with shortcut and keyboard do we have any things like this in C#.

      Are you kidding? [^] :rolleyes: Good luck, you're going to need it.

      led mike

      1 Reply Last reply
      0
      • L Laji59

        If you know we have a thing that is named Accelerator in Visual C++ for working with shortcut and keyboard do we have any things like this in C#. if no; Please help me to impelement like this

        Hello Friends

        P Offline
        P Offline
        Pedram Behroozi
        wrote on last edited by
        #3

        Well, I don't no anything about Accelerator! What do you want to do In C#?

        While (true) { Human.isLearnable = true; }

        L 1 Reply Last reply
        0
        • P Pedram Behroozi

          Well, I don't no anything about Accelerator! What do you want to do In C#?

          While (true) { Human.isLearnable = true; }

          L Offline
          L Offline
          Laji59
          wrote on last edited by
          #4

          I want to manage some Keys like "Alt+F4" ( for example for exit) but I don`t want use "KeyDown" event of controls can I do it in any way ?

          Hello Friends

          D P 2 Replies Last reply
          0
          • L Laji59

            I want to manage some Keys like "Alt+F4" ( for example for exit) but I don`t want use "KeyDown" event of controls can I do it in any way ?

            Hello Friends

            D Offline
            D Offline
            DaveyM69
            wrote on last edited by
            #5

            If this is WinForms, set the form's KeyPreview property to true and handle the form's various key events.

            Dave
            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
            Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

            1 Reply Last reply
            0
            • L Laji59

              I want to manage some Keys like "Alt+F4" ( for example for exit) but I don`t want use "KeyDown" event of controls can I do it in any way ?

              Hello Friends

              P Offline
              P Offline
              Pedram Behroozi
              wrote on last edited by
              #6

              When you turn on KeyPreview, you can manage all events occurring by keyboard in Form_KeyDown:

              private void Form1_KeyDown(object sender, KeyEventArgs e)
              {
              if (e.Modifiers == Keys.Alt && e.KeyCode == Keys.Q)
              Application.Exit(); // It works when KeyPreview is true.
              }

              While (true) { Human.isLearnable = true; }

              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