You can use
RegEx
as follows and modify it as per your need. You can easily
convert it to C#[
^]
If Not isValid(TextBox1.Text) Then
End If
Function isValid(ByVal value As String) As Boolean
Dim rex As New Regex("^\d+((\.|,)\d{0,6})?$")
Return rex.Match(value).Success
End Function
[Edit]
if (!isValid(TextBox1.Text)) {
}
public bool isValid(string value)
{
Regex rex = new Regex("^\d+((\.|,)\d{0,6})?$");
return rex.Match(value).Success;
}