Results 1 to 8 of 8

Thread: Open help file from VB

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Location
    Vietnam
    Posts
    613

    Open help file from VB

    In my app, when pressing F1 key the help file is displayed. However, when the "Tips of the day" form is displayed, pressing F1 does not do anything (in winzip, if "Tips of the day" is shown, pressing F1 key will show the help file as well)


    What should I do to my "Tips of the day" to make it display help file when pressing F1 key?

    Thanks

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    yes.
    Baaaaaaaaah

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Location
    Vietnam
    Posts
    613
    yes
    What's kind of answer is this?

    No wonder he got so many post.

    This is a good site. I did not expect to get some answer like this.

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Keypress event of form?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    If the Tips of the day popup is a form (as against a pic box or frame) then it will have focus and the main form will not receive the key press event. U could make set the keypreview of the Tips form to true and check the keypress event also. NB If the tips of the day form is modal this can cause problems. A better way is to make the form modeless but always on top and then set it to 'not always on top' when the help file is loaded
    Regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  6. #6
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by TheBao


    What's kind of answer is this?

    No wonder he got so many post.

    This is a good site. I did not expect to get some answer like this.
    I thought you only wanted to know wether you should check for a keypress in "Tip of the Day" form too.
    you can use a timer on both form (main form and also Tip of Day form), and then use "GetAsyncKeyState" to see if "F1" is pressed. If yes, then you show the help file.
    Here is how you use "GetAsyncKeyState" API:

    VB Code:
    1. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    2. Private Const VK_F1 = &H70
    3. Private Sub Timer1_Timer()
    4. ' This check to see if F1 is pressed
    5. If (GetAsyncKeyState(VK_F1) <> 0) Then
    6. 'show the help file
    7. End If

    Hope that is a little helpful.
    Baaaaaaaaah

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Location
    Vietnam
    Posts
    613
    Thank you all. Sorry abdul for not understand my question clearly.

    Regards.

  8. #8
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by TheBao
    Thank you all. Sorry abdul for not understand my question clearly.

    Regards.
    No problem I don't know why I read your post like this:

    What should I do to my "Tips of the day". make it display help file when pressing F1 key?
    instead of

    What should I do to my "Tips of the day" to make it display help file when pressing F1 key?
    Baaaaaaaaah

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