Make sure TextBox contains a number and determine if the number is an integer
Make sure TextBox contains a number and determine if the number is an integer
Rate Make sure TextBox contains a number and determine if the number is an integer
(1(1 Vote))
'######################################################
'####### Copyright © 2001 #######
'####### This code was written in VB6 Pro #######
'####### by Imian [email protected] #######
'####### You can use this code freely in #######
'####### your projects but if you redistribute #######
'####### it leave these Credits Here. #######
'####### This sample show a way to understand #######
'####### how to determine whether a string #######
'####### contains a number. #######
'######################################################
Option Explicit
Private Function IsNumber(strg As String)
Dim nInt As String
'Check if string contains a number
If IsNumeric(strg) Then
nInt = Int(strg)
' Check if number is an integer
If strg = nInt Then
' Put your code here
MsgBox "It is an Integer number"
Else
' Put your code here
MsgBox "It is a NON Integer number"
End If
Else
' Put your code here
MsgBox "It is NOT a number"
End If
End Function
Private Sub Command1_Click()
IsNumber Text1.Text
End Sub
Make sure TextBox contains a number and determine if the number is an integer Comments
No comments yet — be the first to post one!
Post a Comment