任何人都可以帮助我了解如何在以下代码中设置快捷键?它应该是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
Run Code Online (Sandbox Code Playgroud)