WPF Key is digit or number

前端 未结 7 684
感情败类
感情败类 2021-01-17 09:36

I have previewKeyDown method in my window, and I\'d like to know that pressed key is only A-Z letter or 1-0 number (without anyF1..12,

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-17 10:07

    Add a reference to Microsoft.VisualBasic and use the VB IsNumeric function, combined with char.IsLetter().

提交回复
热议问题