Click here to Skip to main content
15,884,628 members
Articles / Desktop Programming / WPF

Key press event in WPF

Rate me:
Please Sign up or sign in to vote.
3.25/5 (4 votes)
17 May 2010CPOL 116K   1  
Hi..I want user to enter only numeric values in textbox.I got this code:private void txtType1_KeyPress(object sender, KeyPressEventArgs e){ int isNumber = 0; e.Handled = !int.TryParse(e.KeyChar.ToString(), out isNumber);}but i am not getting textbox_KeyPress...

Revisions


  

Compare Revision Minor Date Status Editor
2 - publicly available No 17-May-10 20:23 Available Abhinav S
1 No 17-May-10 20:15 Composing

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions