Tools Links Login

Accept Only Numbers in Textbox !

Do you want to input only numbers in a textbox? and just want a few lines of code ?Well this code is for you....See it for yourself....Want to know more of my codes then email me....

Original Author: Mark Anthony Dinglasa

Code

'In the KeyPress event of a textbox
'Shall we say you have put one textbox in your form
'Here it goes
Private Sub text1_KeyPress(Keyascii as Integer)
Select case Keyascii
    
case asc(vbcr)  
      Keyascii=0
    
    case 8,46
    case 47 to 58  
    case else
      Keyascii=0
End Select
End Sub

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 100 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.