|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to create shift-F2 function for Textbox - shortcutkey?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 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 Rich wrote: Show quoteHide quote > 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 Many thanks. That was just what I was looking for.
Rich Show quoteHide quote "Ahmed" wrote: > 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 > > > Rich wrote: > > 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 > > Rich,
In addition to the KeyDown event, I would consider using the ProcessCmdKey instead. http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B320583 As it allows you to capture keys that may not show up in the KeyDown event... -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Rich" <R***@discussions.microsoft.com> wrote in message news:84891FAC-0F74-4BB3-99B9-44E5A46FB0B7@microsoft.com... | 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 | |
Close all forms but Main
Visual Basic .NET Compiler converting string to image..?? Printer Command ClickOnce need Help Regex Store encrypted password in my.settings? VB.NET 2.0 & Application Settings.. Delete events/procedures of control if control is deleted at design time in VB.Net 2005 ? Getting the text from a bound combobox. |
|||||||||||||||||||||||