![]() |
|
|
#1
|
|||
|
|||
|
I have a Form with a 3 pages Tab Control. I'm trying to SetFocus in page x with a Hot Key using VB.
To do that I needed to: 1. Create an Event (I choose On Key Down): 2. Write the code Both are not working. I mean I tried the following code for the event but It doesn't work: Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) MsgBox "Key Down" End Sub I am thinking to use the following code for the page focusing. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyF8 Then Me!TabCtl1.Pages(3).SetFocus End Sub Thank you. |
|
#2
|
|||
|
|||
|
i wonder if you could either use:
1) the hotkey code on a property sheet 2) focusing on the tabs you want based on the key you pressed. 1) to do this, I have put something like "&Hide" in the caption property of a cmd button. hence, the shortcut key for pushing the button is Ctrl+H. not sure if you can do that with tabs too, but you could try some focus code behind a button with a caption like "&1" or "&one" 2) i think key press events are only limited to special keys, like tab, enter, etc... I am not sure if you can apply tis event to actual character strokes. I have tested this and I cannot get anything to print when pressing letters. so I think you're stuck with those special keys. if you want to check on the KEYCODE though, I think you'll need an integer. such as: Code:
http://support.microsoft.com/kb/113547 http://support.microsoft.com/kb/210401 |
|
#3
|
|||
|
|||
|
Quote:
I used Page&1, Page&2,... and it's working with ALT+1, Alt+2,...without any VB code. regards. |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| adp accessing issue | fillerup | Security | 3 | 03-10-2010 06:59 AM |
Accessing Table via asp Errors
|
KLynch0803 | Programming | 1 | 01-17-2010 06:59 AM |
| Accessing Code For a Query | TexMax007 | Programming | 3 | 08-29-2009 06:08 AM |
| Accessing form controls | dante | Forms | 15 | 07-28-2009 06:26 AM |
| Accessing subform fields | nkenney | Forms | 1 | 04-21-2009 08:10 PM |