Type of data

  • Thread starter Thread starter danijela
  • Start date Start date
D

danijela

Hello!

Im practically new at VB and i need some help. How can i control the
input data from the user?
I have a textbox in which the user types data and the data must be
integer. How can i put in the program a test weather the data in the
text box is an integer or not? I know it has something to do with TYPE
but i don't know how to use it. is it something like "if
typeof(txtTextBox1)=double then..."? Please help!

Danijela
 
danijela said:
Im practically new at VB and i need some help. How can i control the
input data from the user?
I have a textbox in which the user types data and the data must be
integer. How can i put in the program a test weather the data in the
text box is an integer or not? I know it has something to do with TYPE
but i don't know how to use it. is it something like "if
typeof(txtTextBox1)=double then..."? Please help!

\\\
Dim i As Integer
Try
i = Integer.Parse(Me.TextBox1.Text)
Catch ex As Exception
MsgBox(ex.Message)
End Try
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top