PDA

View Full Version : UserForm - KeyBinding



sk_uc04
10-02-2007, 10:13 AM
Hello Everybody,

Does anyone know whether it's possible to insert a particular keybinding into a Userform?

I have created a module/macro which has the logic for key binding. It is called by a userform sub. I have set Alt+F1 to call the sub which has the logic to display a HelpText.

I have been trying to make it work... but when I press Alt+F1 on the user form, nothing happens. I have the same logic for ThisDocument and the Alt+F1 key works great there.

I thought it will be simple and similar solution to work with the userForm. I would really appreciate any kind of help.

Regards,
SK

lucas
10-02-2007, 12:13 PM
Maybe set the modal property of the userform to true?

sk_uc04
10-02-2007, 12:52 PM
Thanks Lucas, I looked at the ShowModal property and it is set to TRUE.

lucas
10-02-2007, 01:44 PM
I'm sorry...it should be set to false. That will allow you access to the sheet while the form is showing. I'm still not sure that will help with your problem.

sk_uc04
10-03-2007, 10:25 AM
I tried that... its not working :( Thanks a lot for taking initiative.

Regards,
SK

lucas
10-03-2007, 10:43 AM
Hi SK,
We're not having very much luck with this. Why not just put a help button on the userform?

fumei
10-04-2007, 07:19 AM
Does anyone know whether it's possible to insert a particular keybinding into a Userform?Yes, but it is good practice to reset keybindings. Set the keybinding under Userform_Initialize, but put it back in whatever procedure unloads the userform. If the userform is modal, the keybinding will function only with the userform - asssuming you DO put it back.