次のコードでショートカットキーを設定する方法を理解してくれる人はいますか? Alt+X (Exit はボタンの名前です) にする必要があります。を試してみ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