|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
KeyDown Event in VB 2005I have a VB 2005 windows app and I want to recognize keydown events. I have
a form key down event handler but it does not get control when a key is depressed. In playing around I found that if I add a keydown event handler for some control on the form, say a textbox ... Private Sub txtBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtBox.KeyDown) and then give that control focus the keydown event is recognized by that handler. My question is how to I set things up so that when the app is launched and the user presses a key it will be seen by the form's keydown event handler. Thanks. fripper,
If you set the form's KeyPreview property to True you get a first shot at processing all the form's keystrokes. Kerry Moorman Show quoteHide quote "fripper" wrote: > > I have a VB 2005 windows app and I want to recognize keydown events. I have > a form key down event handler but it does not get control when a key is > depressed. In playing around I found that if I add a keydown event handler > for some control on the form, say a textbox ... > Private Sub txtBox_KeyDown(ByVal sender As Object, ByVal e As > System.Windows.Forms.KeyEventArgs) Handles txtBox.KeyDown) > > and then give that control focus the keydown event is recognized by that > handler. My question is how to I set things up so that when the app is > launched and the user presses a key it will be seen by the form's keydown > event handler. > > > > Thanks. > > > > > > > > >
Is it worth while in developing VB.NET or C#.NET
tranferring data from Access to SQL Server Express Baffeled by Treeview Nodes Index!!!!! crazy UserControl Problem with Hashtable Multiple references in the same project. Is there an expected return difference between the following two codes WMI Conversion Very Unpredictable ListBox Behaviour Maximized form questions |
|||||||||||||||||||||||