Search Tools Links Login

Floating Point Numbers Validation


Just like the title says, the code in the attached file will validate the floating point numbers in a text box.

Usage

Create a form with a textbox, and insert the following into the form code:

Private Sub Form_Load()

   Text1.Text = Empty

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

   ' Precision is 2 in this case
   ' Send the Precision Value same in both the Functions
   Call ValidateNum(Text1, 2, KeyAscii)

End Sub

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)

   Call ValidateDel(Text1, 2, KeyCode)

End Sub

About this post

Posted: 2019-08-25
By: RajuV
Viewed: 317 times

Categories

Visual Basic 6

Attachments

fpnumval.zip
Posted: 8/25/2019 2:50:02 PM
Size: 1,329 bytes

Special Instructions

This code originally appeared on AndreaVB.com, and has been republished here with the permission of Andrea Tincani.


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.