compact framework equivalent?

  • Thread starter Thread starter Craig G
  • Start date Start date
C

Craig G

i want to use this on my pda app but it appears the compact framework doesnt have a TryParse method for textboxes

Dim theValue As Double



If theValue.Parse(TextBox1.Text, Globalization.NumberStyles.Float, Application.CurrentCulture.NumberFormat, theValue) = True then

MsgBox("True")

Else

MsgBox("False")

' Not a valid number

End If
 
should read theValue.TryParse........
i want to use this on my pda app but it appears the compact framework doesnt have a TryParse method for textboxes

Dim theValue As Double



If theValue.Parse(TextBox1.Text, Globalization.NumberStyles.Float, Application.CurrentCulture.NumberFormat, theValue) = True then

MsgBox("True")

Else

MsgBox("False")

' Not a valid number

End If
 
Craig G said:
i want to use this on my pda app but it appears the compact framework
doesnt have a TryParse method for textboxes

Dim theValue As Double

If theValue.Parse(TextBox1.Text, Globalization.NumberStyles.Float,
Application.CurrentCulture.NumberFormat, theValue) = True then

MsgBox("True")
Else
MsgBox("False")
' Not a valid number
End If

Use Double.Parse and catch FormatException - if the call succeeds, it's
a valid number, otherwise it's not.
 
Back
Top