textBox’ın keypress olayına aşağıdaki kodu yazıyoruz.
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
string str = “0123456789″;
if (str.IndexOf(e.KeyChar) == -1)
e.KeyChar = ‘\0′;
}
Tags: csharp sayı kontrolü, sayı kontrol fonksiyonu, textbox a sayımı girildi, textbox sayı kontrolü