How I can tell the user by showing a MSG box that what he enterd is not in the right format
I have textbox that i want to get only numbers and if the user entered letters instead to show him a msg
int level;
if(range.Text.GetType)
{
MessageBox.Show("Please Enter Only Number");
}
else
{
level = int.Parse(range.Text);
// use the randomGenerator function according to the number i entered.
TheRandNo = randomGenerator.Next(level);
//Activate the guess button.
GuessBT.Enabled = true;
label4.Text = x.ToString();
// To start the game with the green color
BackColor = Color.Green;
}
thanx in advance
1 Answer