I have seen similar questions which attempt to solve this issue, but none seem to work for me so far...
Basically, for my first VB project, I am creating a virtual keyboard where a sound is played from the resources on KeyDown. So far, the program seems to work except for the fact that each key needs to be clicked by the mouse before the sound is played by pressing each key (hence put the object in focus), where I need the key to play the sound without clicking the keyboard key (put the object in focus on KeyDown). Below is an example of my code:
Private Sub C_KeyDown(ByVal sender As System.Object, ByVal e As PreviewKeyDownEventArgs) Handles C.PreviewKeyDown ' C is the label attached to the first 'Rectangle' (Key)
If (e.KeyCode = Keys.A) Then 'The A key should activate the C key on the keyboard
I have KeyPreview set to 'True' under the form's properties.
1 Year Ago
Related Article:save dialog box in dot net 2003 using vb dot net
is a VB.NET discussion thread by samrudhi_12 that has 1 reply, was last updated 10 months ago and has been tagged with the keywords: save, dialog, box, in, dot, net, 2003, using, vb.