Aug 4th, 2004, 04:10 PM
#1
Thread Starter
Hyperactive Member
ESC key?
Does anyone know what setting you change to be able to push the ESC key and the window will close? Thanks!
Brenda
Aug 4th, 2004, 05:16 PM
#2
Member
Well if you have close (or cancel) button on the form then all you have to do is go to your Form property and set CancelButton option to your Close button.
Aug 4th, 2004, 09:11 PM
#3
Fanatic Member
this mate?
VB Code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Escape Then
Close()
End If
End Sub
first set the form.keypreview property to true. if this doesn't help, i'm sorry.
Aug 5th, 2004, 09:12 AM
#4
Thread Starter
Hyperactive Member
Niether of those work. Or maybe I am just doing it wrong. Any other suggestions?
Aug 5th, 2004, 09:49 AM
#5
Member
It work’s on my system. I attached example file.
Attached Files
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width