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

沒有留言:

張貼留言

Messaging API作為替代方案

  LINE超好用功能要沒了!LINE Notify明年3月底終止服務,有什麼替代方案? LINE Notify將於2025年3月31日結束服務,官方建議改用Messaging API作為替代方案。 //CHANNEL_ACCESS_TOKEN = 'Messaging ...