Does anyone knows how to code to format the textbox to accept only percentage. (3 digits, 1 decimal point, 2 digits) ? i also want to be able to set the limit to 100.00.
Printable View
Does anyone knows how to code to format the textbox to accept only percentage. (3 digits, 1 decimal point, 2 digits) ? i also want to be able to set the limit to 100.00.
heres some code to only accept numbers and a decimal point...hope this help.
VB Code:
Dim KeyAscii As Integer KeyAscii = Asc(e.KeyChar) 'only allow numbers, a single decimal point, backspace or enter Select Case KeyAscii Case Asc("0") To Asc("9"), Asc(ControlChars.Back), Asc("-") 'acceptable(keystrokes) e.Handled = False Case Asc(".") e.Handled = False Case Else e.Handled = True End Select