Question : validate text box for integer

I want a validate a text box so it has only integer neither empty nor leading spaces

Answer : validate text box for integer

Will this work for you?

int test;
            if (int.TryParse(txt.Text, out test))
            {
                //successful
            }
            else
            {
                //error
            }
Random Solutions  
 
programming4us programming4us