Computing.Net > Forums > Programming > textbox in VB.net

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

textbox in VB.net

Reply to Message Icon

Name: connie_triz1
Date: September 12, 2008 at 08:37:16 Pacific
OS: xp
CPU/Ram: 128
Product: ibm
Comment:

Hi everyone need help!
i'm using vb.net and i would like to know the right codes for textbox that only accepts 16 numeric characters.
thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: September 12, 2008 at 16:18:09 Pacific
Reply:

Meh, why not? Not like I ain't got nothin' better to do.

Step 1: Make a TextBox called, say, txtBx.

Step 2: Set txtBx's MaxLength to 16.

Step 3: Add this Sub:

Private Sub txtBx_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) _
Handles txtBx.KeyPress
Const Back As Char = ChrW(Keys.Back) : Const Del As Char = ChrW(Keys.Delete)
e.Handled = ((e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso _
(e.KeyChar <> Back AndAlso e.KeyChar <> Del))
End Sub


0

Response Number 2
Name: connie_triz1
Date: September 13, 2008 at 03:09:57 Pacific
Reply:

Hi Razor2.3 !

thanks so much for help...it solved my problem. :-) thank you thank you!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


wont XCopy All Users Script To Change IE Proxy...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: textbox in VB.net

Cleat textBoxex in vb.net www.computing.net/answers/programming/cleat-textboxex-in-vbnet/9491.html

Disable Close (x) Button in VB.NET www.computing.net/answers/programming/disable-close-x-button-in-vbnet/8319.html

How to clear a textbox in asp.net www.computing.net/answers/programming/how-to-clear-a-textbox-in-aspnet-/8234.html