If you are only checking if the input is valid when the user clicks OK, try something like this:
double userinput = 0;
bool isvalid = double.TryParse(yourtextbox.text, out userinput);
if (!isvalid)
{
MessageBox.Show("Invalid Entry");
}
else
{
MessageBox.Show("You entered: " + userinput.ToString());
}
Hope this helps :-)