VB6怎么为按钮设置热键
答案:1 悬赏:70 手机版
解决时间 2021-11-17 06:13
- 提问者网友:自食苦果
- 2021-11-16 15:53
VB6怎么为按钮设置热键
最佳答案
- 五星知识达人网友:夜余生
- 2021-11-16 16:53
重写窗体的ProcessCmdKey:
Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
Select Case keyData
Case Keys.F1
MessageBox.Show("F1")
Me.Button1.PerformClick()
Case Keys.F2
MessageBox.Show("F2")
Button2_Click(Nothing, Nothing)
Case Keys.F4
MessageBox.Show("F4")
Me.Close()
End Select
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
Protected Overrides Function ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As Boolean
Select Case keyData
Case Keys.F1
MessageBox.Show("F1")
Me.Button1.PerformClick()
Case Keys.F2
MessageBox.Show("F2")
Button2_Click(Nothing, Nothing)
Case Keys.F4
MessageBox.Show("F4")
Me.Close()
End Select
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯