|
-
Jun 8th, 2000, 06:33 AM
#1
Thread Starter
Hyperactive Member
Hi All,
Just printed the character set 0-127 and 128-255 from the VB Help file. I was looking for the numerical values which represent function keys.
I know one of you who is reading this now has the answer.

So start talkin' err typing!
Thanks,
Sal
-
Jun 8th, 2000, 06:36 AM
#2
They can be represented by Constants.
vbKeyF1
vbKeyF2
vbKeyF3
vbKeyF4
etc.
-
Jun 8th, 2000, 06:42 AM
#3
Thread Starter
Hyperactive Member
How you doin' megatron?

Thanks for the quick response. Just found that same answer as a reference in one of my many books.
Thanks again,
Sal
-
Jun 8th, 2000, 06:48 AM
#4
For a whole list of them, refer to Keycode Constants in your Help File.
-
Jun 8th, 2000, 06:53 AM
#5
Thread Starter
Hyperactive Member
Megatron,
I'm trying to setup a function key that will allow the user to call a sub (ex - Private Sub Command1_Click() ). I wonder if any of the other controls on the form would conflict with the keyup event?????
Ideas?
Thanks again,
Sal
-
Jun 8th, 2000, 07:00 AM
#6
If you have a PictureBox, TextBox, RichTextBox (and probably some others) it might cause conflicts because they have the focus when they the Form starts up.
-
Jun 8th, 2000, 07:08 AM
#7
Thread Starter
Hyperactive Member
Yea...
Still researching this. I wonder if there is a command button or maybe an OCX which has the keycode property or shortcut key property. That would be perfect. I'll let you know what I find out.
Sal
-
Jun 8th, 2000, 07:49 AM
#8
transcendental analytic
Be aware of the menu shortcuts also, even if you have keypreview set and use textbox to paste, you will fire the menu code instead. Otherways, keypreview is the best way to dismiss this problem
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 8th, 2000, 08:00 AM
#9
Thread Starter
Hyperactive Member
You know, this should be simple. There are games that allow you to press a function key while all kinds of junk is going on. You could for example press F4 to bring the flaps full down while in a left turn, and it works irregardless of what has focus.
Kedaman I think is on to something. I am studying the vb-helpfile as we speak.
Will report the solution here, along with the code.
Thanks,
Sal
-
Jun 8th, 2000, 08:41 AM
#10
Thread Starter
Hyperactive Member
Great!

Got the answer. It was in the MSD Library. Here it is...
KeyPreview Property Example
This example creates a form keyboard handler in the KeyDown event. Each of the first four function keys displays a different message. To try this example, paste the code into the Declarations section of a form, and then press F5. Once the program is running, press any one of the first four (F1 – F4) function keys.
Code:
Private Sub Form_Load ()
KeyPreview = True
End Sub
Private Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF1: MsgBox "F1 is your friend."
Case vbKeyF2: MsgBox "F2 could copy text."
Case vbKeyF3: MsgBox "F3 could paste text."
Case vbKeyF4: MsgBox "F4 could format text."
End Select
End Sub
Your leads were good.
Thanks,
Sal
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
|