Merhabalar,
Bu günkü yazımda textbox’a text veri girmenin yöntemini sizlere anlatacağım. Textbox’ın WF için KeyPress Event’ine WPF için ise PreviewTextInput’una aşağıdaki gibi bir kod yazmanız işi çözecektir.
void txttipkisaltmasi_PreviewTextInput(object sender, TextCompositionEventArgs e) { if (char.IsDigit(e.Text, e.Text.Length - 1)) { e.Handled = true; } }
Kolay gele.