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
-
-
Git Workflow For Enterprise development5 years ago
-
-
Watch Live Cricket Online Free13 years ago
-
-
-