1 2 3 4 5 6 7 8 9 10 | Private Function DetectKeys(ByVal intKey As Integer) As Boolean Select Case intKey Case 43, 45 '45 = - (Numeric) '43 = + (Numeric) Return True Case Else Return False End Select End Function |
1 2 3 | Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress e.Handled = DetectKeys(Asc(e.KeyChar)) End Sub |
沒有留言:
張貼留言