If i press the keydown key ,is it possible to have a sound when i do this if so,can you show me please .thanks paul
Printable View
If i press the keydown key ,is it possible to have a sound when i do this if so,can you show me please .thanks paul
Heres a little example, its just basic tho.
Notice the form has KeyPreview=true on it. Search for an explination if you need one, its been covered many times.
i need to assign it it just one key it seems to play sound with all the keys ..the key i need in the down key.hope its not to much to ask thanks again.paul
Sorry, your first post said the keydown (which is actually an event in vb).
All you have to do, is replace the keypress function with this one
VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyDown Then PlaySpeakerWave "C:\WINDOWS\Media\chimes.wav" End If End Sub
Note, a keypress only gives you standard keys, while a keyup and keydown event gives you all keys.