谁能帮我理解如何在下面的代码中设置快捷键?它应该是 Alt+X(退出是按钮的名称)。我试过cmd_Exit.text="&Exit"
了,但是它打印了“&”并且没有设置快捷键。
Private Sub cmdExit_Click(sender As Object, e As EventArgs) Handles cmdExit.Click
'cmdExit.Capture()
Dim response = MsgBox("Are you sure you want to exit?", CType(MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, MsgBoxStyle), "Leaving?")
If response = MsgBoxResult.Yes Then 'if yes exit the application
Application.Exit()
End If
End Sub