Hej,
Hope someone can help me with this. Is there a Widows form method equivalent to console.readline? I am trying to validate and input using tryParse to ensure a doulbe is inputted if not display a error message. I got that to work eg when i input an A . But i don't want to continue unless a double is inputted. This is my code i tried but i am missing something:

Public Function IsDouble() As Boolean
IsDouble = True
Dim vDouble As Double

'Function required to validate input
If Not Double.TryParse(txtbox1.Text, vDouble) Then '
MessageBox.Show("enter a double please!")
txtValue.Clear()

Return IsDouble
End If
End Function

A double can be a 1 or a 1.2 or a .0034567. Just convert the entered number to a double.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.