Results 1 to 13 of 13

Thread: F1

  1. #1

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604

    Post

    hi,

    how do i when i click on label make it press the f1 key so that my .hlp file will load


    cheers

    Merlin ?

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  2. #2
    Guest
    Do you mean you want your help file to popup with the user clicks on label1, just like pressing F1?

    If it is, you can call the code that the F1 key uses in the label's click event.

    Sunny

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Sunnyl:

    How do you do that..when your app is running, manually click F1 and see what happens..."Nothing".
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    Guest
    I had been under the impression that he had already created a help file, which was already readily accessible by pressing F1, and he had wanted to simulate that keypress by clicking a label. That was how I had translated his question to be.

    Sunny

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    zmerlinz

    This may be of interest to you.

    http://www.vb-world.net/articles/helpapi/
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    OK..I thought perhaps you had something I could use
    with this code as this will trigger the key event but that is all.......Oh well, It never hurts to ask..Thanks.

    Wayne


    ' trap keys and use your code for their events
    Code:
     Option Explicit
    
     Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        Select Case KeyCode
           Case vbKeyF1: MsgBox "F1 pressed."
         End Select
     End Sub
    
    Private Sub Form_Load()
      Form1.KeyPreview = True
    End Sub
    
    Private Sub Label1_Click()
       Call Form_KeyDown(vbKeyF1, 0)
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  7. #7
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Talking i got it

    There's a SendKeys statement it's to send one or more keystrokes to the active window as if typed at the keyboard.

    SendKeys "{F1}",True

    {F1} is the code for f1, if u want more code for other key, just ask.

    Hope it help

  8. #8
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I think setting the help file in the properties of the Project will make it accesable via F1, otherwise use or the CommonDialog, or use ShellExecute API to open the HLP file.

    You can ask for code if ya want!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  9. #9

    Thread Starter
    Fanatic Member zmerlinz's Avatar
    Join Date
    May 2000
    Location
    in a world where the sun always shines on the bloody tv!!
    Posts
    604
    cheers sebs that is what i was after, sorry to all about wording the question, i was on the 'net at school and had to be quick

    Cheers

    Merlin ?

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

    [Galahtech.com] | [My Site] | [Fishsponge] | [UnixForum.co.uk]

  10. #10
    Guest

    Re: <?>

    Originally posted by HeSaidJoe
    Sunnyl:

    How do you do that..when your app is running, manually click F1 and see what happens..."Nothing".
    Go to Project > Properties and whatever is listed under Help File Name will open when the user hits F1.

  11. #11
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Megatron

    'ok, that what I was after. Now for and encore, can you see any reason this won't work. I insert the path and file for
    the api help dialog.

    I use this code and it messages ME but the api help file
    dialog doesn't open

    If I manually press F1 then it messages Me and the api help
    file dialog opens
    Code:
    Option Explicit
    
     Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
      If vbKeyF1 Then MsgBox "ME"
     End Sub
    
    Private Sub Form_Load()
      Form1.KeyPreview = True
    End Sub
    
    Private Sub Label1_Click()
       Call Form_KeyDown(vbKeyF1, 0)
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  12. #12
    Guest
    It's because when you use Call Form_KeyDown(vbKeyF1, 0) you are actually calling this event not the WM_KEYDOWN message. The help file will only display if the WM_KEYDOWN message is sent.

    As a work around, send the WM_KEYDOWN message or use the SendKeys function.

  13. #13
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    thanks
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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