how to create shift-F2 function for Textbox - shortcutkey?

G

Guest

Hello,

I need to add a shift-F2 function to textboxes to bring up a dialogform
with the expanded text contained in the respective Textbox. On any of the
keydown events of a textbox I can only trap for one key - well, I only know
how to trap for one key. How can I trap for Shift-F2 combination? I see
that menuItems have shortcutkey options. How can I create similar
functionality for the textbox control?

Thanks,
Rich
 
A

Ahmed

Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.Shift And e.KeyCode = Keys.F2 Then
MsgBox("")
End If


End Sub
 
J

Jay B. Harlow [MVP - Outlook]

Rich,
In addition to the KeyDown event, I would consider using the ProcessCmdKey
instead.

http://support.microsoft.com/default.aspx?scid=kb;en-us;320583

As it allows you to capture keys that may not show up in the KeyDown
event...

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Hello,
|
| I need to add a shift-F2 function to textboxes to bring up a dialogform
| with the expanded text contained in the respective Textbox. On any of the
| keydown events of a textbox I can only trap for one key - well, I only
know
| how to trap for one key. How can I trap for Shift-F2 combination? I see
| that menuItems have shortcutkey options. How can I create similar
| functionality for the textbox control?
|
| Thanks,
| Rich
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top