you should have write more detail about what you have to verify. for example I have verify the text with text length not less then 8 and not greater then 22. Create
one textbox (TB) and one Lable (lB)
here the code:
private void textBox1_TextChanged(object sender, EventArgs e)
{
lB.Text = test(tb.Text);
}
public string test(string test){
int a=test.Length;
if (a > 8 && a<22)
{
return "Ok";
}
else
{
return "Not Valid";
}
}
}