|
Thread: F1
-
Sep 22nd, 2000, 07:38 AM
#1
Thread Starter
Fanatic Member
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]
-
Sep 22nd, 2000, 07:58 AM
#2
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
-
Sep 22nd, 2000, 08:13 AM
#3
_______
<?>
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
-
Sep 22nd, 2000, 08:17 AM
#4
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
-
Sep 22nd, 2000, 08:17 AM
#5
_______
<?>
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
-
Sep 22nd, 2000, 08:21 AM
#6
_______
<?>
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
-
Sep 22nd, 2000, 10:05 AM
#7
Frenzied Member
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
-
Sep 22nd, 2000, 12:14 PM
#8
Frenzied Member
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.
-
Sep 22nd, 2000, 02:24 PM
#9
Thread Starter
Fanatic Member
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]
-
Sep 22nd, 2000, 03:12 PM
#10
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.
-
Sep 22nd, 2000, 04:08 PM
#11
_______
<?>
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
-
Sep 22nd, 2000, 05:13 PM
#12
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.
-
Sep 22nd, 2000, 05:27 PM
#13
_______
"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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|