2,854 questions
The validation can be done in this manner:
float f;
if( ! float.TryParse( textBox1.Text, out f ) )
{
// Error. Show an error message or indicator
// . . .
}
else
{
// Success
// . . .
}
It can be done after pressing the action button like "OK", "Save", etc.