使用Esc键关闭对话框

时间:2020-02-07 23:05:29   收藏:0   阅读:78
Private Sub ss_Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        
        ‘对话框的KeyPreview属性需设置为True
        e.Handled = True

        If e.KeyValue = 27 Then
            Me.Close()
        End If
End Sub

 


 


 

原文:https://www.cnblogs.com/rf8862/p/12274839.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!