O
OSVBNET
Guest
Hey all
I limit allowed characters in a text box using KeyPress & TextChanged, here's my TextChanged part:
Dim A, B As Integer
Dim FileNameFilter As String = String.Empty
For A = 0 To MessageTextBoxX.TextLength - 1
B = Convert.ToInt32(MessageTextBoxX.Text.Chars(A))
Select Case B
'Allow Dot and Numbers
Case 46, 48 To 57
'OK. Do nothing.
FileNameFilter = FileNameFilter + MessageTextBoxX.Text.Chars(A)
Case Else
'Not good.
End Select
Next
MessageTextBoxX.Text = FileNameFilter
How to add Ctrl+V support?
Continue reading...
I limit allowed characters in a text box using KeyPress & TextChanged, here's my TextChanged part:
Dim A, B As Integer
Dim FileNameFilter As String = String.Empty
For A = 0 To MessageTextBoxX.TextLength - 1
B = Convert.ToInt32(MessageTextBoxX.Text.Chars(A))
Select Case B
'Allow Dot and Numbers
Case 46, 48 To 57
'OK. Do nothing.
FileNameFilter = FileNameFilter + MessageTextBoxX.Text.Chars(A)
Case Else
'Not good.
End Select
Next
MessageTextBoxX.Text = FileNameFilter
How to add Ctrl+V support?
Continue reading...