I was given this but it doesn't work...????
Set KeyPreview = true
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If (KeyCode = 27) Then Unload Me
End Sub
Printable View
I was given this but it doesn't work...????
Set KeyPreview = true
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If (KeyCode = 27) Then Unload Me
End Sub
Try.
1. Setting the KeyPreview property at deisng time.
2.
The other bit looks ok.Code:Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Try this
Code:Private Sub Form_Keydown(KeyAscii As Integer, shift As Integer)
Dim ShiftDown As Boolean
Dim AltDown As Boolean
Dim CtrlDown As Boolean
ShiftDown = (shift And vbShiftMask) > 0
AltDown = (shift And vbAltMask) > 0
CtrlDown = (shift And vbCtrlMask) > 0
Select Case KeyAscii
Case vbKeyReturn
Call cmd1_Click
Exit Sub
Case vbKeyEscape
Unload Me
End Select
End Sub
dumb dumb here...I set the property but what I
forgot was I am playing a wav file while the nag
does it's nagging...I need to kill the wav because
it plays till it is finished...
Call sndPlaySound(ByVal App.Path & "\sitting.wav", SND_SYNC)
Timer1.Enabled = False
Unload Me
Load frmPicDisplay
frmPicDisplay.Show
...would you know how to abort if esc is pressed?
See your other post regarding Killing WAV files.
http://forums.vb-world.net/showthrea...threadid=20936