1

Button.click イベントの作成方法 テンキーパッドで Enter キーとピリオド (del) キーの両方を実行しますか?

コードスニペット:

Private Sub frmCalc_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
     Select Case e.KeyCode
        Case Keys.NumPad0
            btn0.PerformClick()
        Case Keys.NumPad1
            btn1.PerformClick()
      'etc.
    End Select
End Sub

Case Keys.Enter動作しCase Keys.Separatorません。period(del) キーの Keys.OEMPeriod のようなものもありません。

KeyPressイベントなどでエンターキーを呼び出してみましたが、役に立ちませんでした。

何か案は?学校のプロジェクトで Windows の calc.exe を模倣しようとしていますが、テンキー機能などのいくつかの機能を追加しようと考えています。

4

1 に答える 1

0

You can figure this out by yourself.

Set a breakpoint at the beginning of your KeyDown handler in the debugger, press one of those keys, and check the value of e.KeyCode in the Locals window.

于 2009-11-03T02:12:52.180 に答える