vb.net - Vb. net, input inside textbox -


i can't use backspace button in keyboard in changing or editing being inputted user when he/she commits mistake inputting series of integers...help me please...

private sub tbx3_keypress(sender object, e keypresseventargs) handles tbx3.keypress     if cint(val(e.keychar)) = 8         return     end if     dim allowedchar string = "1234567890"     if not (allowedchar.contains(e.keychar))         e.keychar = cchar(e.keychar)          e.handled = true     end if  end sub 

try this

 if (microsoft.visualbasic.asc(e.keychar) < 48) _           or (microsoft.visualbasic.asc(e.keychar) > 57)         e.handled = true end if if (microsoft.visualbasic.asc(e.keychar) = 8)         e.handled = false end if 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -