2017年10月12日 星期四

Handling keystrokes


Handling keystrokes at the form’s level

Private Sub CalculatorForm_KeyPress(ByVal sender As Object,
                   ByVal e As System.Windows.Forms.KeyPressEventArgs)
                   Handles Me.KeyPress

Select Case e.KeyChar
 Case "1" : bttn1.PerformClick()
 Case "2" : bttn2.PerformClick() 
 Case "3" : bttn3.PerformClick() 
 Case "4" : bttn4.PerformClick() 
 Case "5" : bttn5.PerformClick() 
 Case "6" : bttn6.PerformClick() 
 Case "7" : bttn7.PerformClick() 
 Case "8" : bttn8.PerformClick() 
 Case "9" : bttn9.PerformClick() 
 Case "0" : bttn0.PerformClick() 
 Case "." : bttnDecimalPoint.PerformClick()
 Case "C", "c" : bttnClear.PerformClick()
 Case "+" : bttnPlus.PerformClick()
 Case "-" : bttnMinus.PerformClick()
 Case "*" : bttnMultiply.PerformClick()
 Case "/" : bttnDivide.PerformClick()
  Case "=" : bttnEquals.PerformClick()
 End Select

End Sub

沒有留言:

張貼留言

2024_09 作業3 以Node-Red 為主

 2024_09 作業3  (以Node-Red 為主  Arduino 可能需要配合修改 ) Arduino 可能需要修改的部分 1)mqtt broker  2) 主題Topic (發行 接收) 3) WIFI ssid , password const char br...