0
私は1つのフォームを持っています。Escキーを押してデバッグを停止
Private Sub Form2_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Select Case e.Key
Case Key.Escape
Me.close()
Case Else
' do nothing
End Select
End Sub
・ホープ、この:ここでは、コード
Private Sub Form2_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Select Case MessageBox.Show("Are you sure you want to exit?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
Case Windows.Forms.DialogResult.Yes
Application.Exit() ' Close the form and also debugging
'nothing to do here the form is already closing
Case Windows.Forms.DialogResult.No
e.Cancel = True 'cancel the form closing event
'minimize to tray/hide etc here
End Select
End Sub