In textbox's keypress event put this condition,
if (e.KeyChar == " " && c.Text.Length==0)
{ e.Handled = True;}
if (IsNumeric(e.Keychar))
{ e.Handled = True;}
IsNumeric function...
public static Boolean IsNumeric(string stringToTest)
{
int result;
return int.TryParse(stringToTest, out result);
}
Happy Coding!
:)