Decimal number validation in c# vb.net

Decimal number validation in c# vb.net
==================================================================================
private void textbox1_TextChanged(object sender, EventArgs e)
{
if (textbox1.Text != string.Empty)
{
string str = textbox1.Text.Trim();
double num;
bool isnum = double.TryParse(str, out num);
if (isnum)
{
}
else
{
textbox1.Text = string.Empty;
MessageBox.Show("Invalid Number");
}
}
}
==================================================================================

No comments: