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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to activate F1 to F12 keys

How to activate F1 to F12 keys

Scheduled Pinned Locked Moved C#
databasetutorialquestion
4 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    ayuba asia
    wrote on last edited by
    #1

    I want check if the user press the F1 to F12 keys i try put it under keypress method of the form but the F1 to F12 key is not captured by key press event i want to know how do i trigger F1 to F12 keys thanks in advance.... Jalil

    E L 2 Replies Last reply
    0
    • A ayuba asia

      I want check if the user press the F1 to F12 keys i try put it under keypress method of the form but the F1 to F12 key is not captured by key press event i want to know how do i trigger F1 to F12 keys thanks in advance.... Jalil

      E Offline
      E Offline
      ekynox
      wrote on last edited by
      #2

      have you tried using the KeyDown eventhandler an example would be private void Form1_KeyDown(object sender, KeyEventArgs e) { if (Keys.F12.ToString() == e.KeyCode.ToString()) { MessageBox.Show("F12 Key Pressed"); } else { MessageBox.Show("F12 Key was not Pressed"); } }

      1 Reply Last reply
      0
      • A ayuba asia

        I want check if the user press the F1 to F12 keys i try put it under keypress method of the form but the F1 to F12 key is not captured by key press event i want to know how do i trigger F1 to F12 keys thanks in advance.... Jalil

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        You might wanna enable KeyPreview on your container Form to in addition to method suggested by the other poster. xacc.ide-0.1.1 released! :) Download and screenshots

        A 1 Reply Last reply
        0
        • L leppie

          You might wanna enable KeyPreview on your container Form to in addition to method suggested by the other poster. xacc.ide-0.1.1 released! :) Download and screenshots

          A Offline
          A Offline
          ayuba asia
          wrote on last edited by
          #4

          thanks for the reply it works.

          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