i already got this.
Code:
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
int ascii = Convert.ToInt16(e.KeyChar);
if ((ascii >= 48 && ascii <= 57) || (ascii == 8) || (ascii==32))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}