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 make button F1 ( Help ) enable in my application ?

How make button F1 ( Help ) enable in my application ?

Scheduled Pinned Locked Moved C#
helptutorialquestion
6 Posts 5 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
    Lost User
    wrote on last edited by
    #1

    Hi, I have some Form ( WinForm ) that on him i have button "Help". I want to make the keyboard button F1 enable and in case that the application user will press on the F1 => then the help button will be press / or the some method in my application will be call. How to do it ? Thanks for any help.

    N L M 3 Replies Last reply
    0
    • L Lost User

      Hi, I have some Form ( WinForm ) that on him i have button "Help". I want to make the keyboard button F1 enable and in case that the application user will press on the F1 => then the help button will be press / or the some method in my application will be call. How to do it ? Thanks for any help.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Yanshof wrote:

      have some Form ( WinForm ) that on him i have button "Help".

      You can set short cut key for that menu as F1. Then menu code will be called


      My Website | Ask smart questions

      L 1 Reply Last reply
      0
      • N N a v a n e e t h

        Yanshof wrote:

        have some Form ( WinForm ) that on him i have button "Help".

        You can set short cut key for that menu as F1. Then menu code will be called


        My Website | Ask smart questions

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Ok, And how do i do it ? Is there is some other way ?

        K 1 Reply Last reply
        0
        • L Lost User

          Ok, And how do i do it ? Is there is some other way ?

          K Offline
          K Offline
          Kristian Sixhoj
          wrote on last edited by
          #4

          Create a new form - This form will be the help window. Now, click in the main form, and set it's KeyDown event. Write the following code in the event handler:

          if (e.KeyCode == Keys.F1)
          {
          HelpForm helpForm = new HelpForm();
          helpForm.ShowDialog();
          }

          If your help form isn't called 'HelpForm' then write the correct name instead of.

          Virtual1ty


          "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

          1 Reply Last reply
          0
          • L Lost User

            Hi, I have some Form ( WinForm ) that on him i have button "Help". I want to make the keyboard button F1 enable and in case that the application user will press on the F1 => then the help button will be press / or the some method in my application will be call. How to do it ? Thanks for any help.

            L Offline
            L Offline
            Lutoslaw
            wrote on last edited by
            #5

            Just handle Form.HelpRequested event :) Edit: If ya want to have a "question mark"-button in the top-right corner, set HelpButton property to true and both MaximizeBox and MinimizeBox to false; -- modified at 11:50 Tuesday 25th September, 2007

            Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.

            1 Reply Last reply
            0
            • L Lost User

              Hi, I have some Form ( WinForm ) that on him i have button "Help". I want to make the keyboard button F1 enable and in case that the application user will press on the F1 => then the help button will be press / or the some method in my application will be call. How to do it ? Thanks for any help.

              M Offline
              M Offline
              Matthew Cuba
              wrote on last edited by
              #6

              Why not add a System.Windows.Forms.HelpProvider by dropping one onto your form, set its HelpNamespace to the .chm file you want to open and then in your form's properties, set the HelpKeyword and HelpNavigator properties? the Visual Studio 2005 documentation has an example in C# for the HelpProvider class. Good Luck!

              It isn't enough to do well in life. One must do good when and where one can. Otherwise, what's the point?

              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