Results 1 to 7 of 7

Thread: Intercepting F1 key

  1. #1

    Thread Starter
    Hyperactive Member divined's Avatar
    Join Date
    Aug 2004
    Location
    Thessaloniki, Greece
    Posts
    447

    Intercepting F1 key

    Hello everybody

    I have an MDI VB 6 application. Child forms can be opened from various menus in that form. I would like the user to be able to call the Help subsystem by pressing the F1 key anywhere in the application.
    Is there an easy way to do this? E.t.c. from the KeyPress event of a form or do I need to subclass the events message hanlder?

    thx, in advance

    George Papadopoulos
    SteadFast!

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Intercepting F1 key

    I don't think you need to trap it, I think its just about setting properties for the forms and controls...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Hyperactive Member divined's Avatar
    Join Date
    Aug 2004
    Location
    Thessaloniki, Greece
    Posts
    447

    Re: Intercepting F1 key

    I have found that in the project properties I can input a help file. Does this mean that the Help file is being incorporated into the executable?
    SteadFast!

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Intercepting F1 key

    Quote Originally Posted by divined
    I have found that in the project properties I can input a help file. Does this mean that the Help file is being incorporated into the executable?
    u r right.......using the project properties regarding help file, u just need to enter the filename n there u got it, just click the F1 key n this help file will be incorporated into the Exe of ur project.
    Show Appreciation. Rate Posts.

  5. #5

    Thread Starter
    Hyperactive Member divined's Avatar
    Join Date
    Aug 2004
    Location
    Thessaloniki, Greece
    Posts
    447

    Re: Intercepting F1 key

    The only drawback being that my application is MDI. Thus, when only the main form is open pressing F1 has no effect whatsoever. If a single child form is opened then it works.

    Any ideas on why this is so?
    SteadFast!

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Intercepting F1 key

    If it doesn't work I'd suggest you trap the KeyPress event in your MDI parent form.

  7. #7
    Hyperactive Member vincentg's Avatar
    Join Date
    Jun 2005
    Location
    Chicago IL, USA
    Posts
    261

    Re: Intercepting F1 key

    I have also got some problems like this in VB6.0 which if I make a code in the menu which supposed to be pops up the Help file
    VB Code:
    1. Private Sub mnuContent_Click()
    2.     SendKeys "{F1}", True
    3. End Sub

    But it doesnt work at all, well it gave me no choice but to make a small form frmHelp
    and recode it like this and it pops the Help File...

    VB Code:
    1. Private Sub mnuContent_Click()
    2.     frmHelp.Visible = False
    3.     frmHelp.Show
    4.     SendKeys "{F1}", True
    5.     frmHelp.Hide
    6. End Sub


    BTW, the HELP file was also integrated in the Project Property.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width