1
任何人都可以幫助我瞭解如何在以下代碼中設置快捷鍵? 它應該是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
對於記錄,就沒有必要使用[**'Call'關鍵字**](https://msdn.microsoft.com/en-us/library/sxz296wz.aspx)在這種情況下,因爲它是多餘的。 –
哎呀...很好,趕快,謝謝 – soohoonigan