Wednesday, September 09, 2009
Numeric only , windows programing , C#.Net
9:42 PM |
Posted by
Sheen |
Edit Post
If you want to restrict a text box, to enter only numeric values.
Just do the following in the KeyPress event.
private void txtOpenCount_KeyPress(object sender, KeyPressEventArgs e)
{
string str = "\b0123456789";
e.Handled = !(str.Contains(e.KeyChar.ToString()));
}
Just do the following in the KeyPress event.
private void txtOpenCount_KeyPress(object sender, KeyPressEventArgs e)
{
string str = "\b0123456789";
e.Handled = !(str.Contains(e.KeyChar.ToString()));
}
Subscribe to:
Posts (Atom)
Blog Archive
Important Blogs
-
-
BDD with Rails and Cucumber10 years ago
-
-
Watch Live Cricket Online Free14 years ago
-
BBC and Mahinda Rajapakshe15 years ago
-
-