如何在输入框中接受连字符和数值?
我有
Private Sub TextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles inputBox_1.KeyDown
Select Case e.KeyCode
Case Keys.D0 To Keys.D9, Keys.NumPad0 To Keys.NumPad9, _
Keys.Back, Keys.Delete, Keys.Left, Keys.Right
If e.Shift = True Then
e.SuppressKeyPress = True
Exit Sub
End If
e.SuppressKeyPress = False
Case Else
e.SuppressKeyPress = True
End Select
End Sub
但是当我在行中输入“-”字符时它失败了
Keys.D0 To Keys.D9, Keys.NumPad0 To Keys.NumPad9, _
Keys.Back, Keys.Delete, Keys.Left, Keys.Right
如何让连字符写成?