2
我製作了一個文本框,它僅將字符使用限制爲數字和句點。很好,但現在我不能進入退格鍵來修改我的文本框中輸入的任何數據。我怎樣才能解決這個問題?文本框不允許按退格鍵?
Private Sub TextBox10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox10.KeyPress
Dim allowedChars As String = "1234567890."
If allowedChars.IndexOf(e.KeyChar) = -1 Then
' Invalid Character
e.Handled = True
End If
End Sub