开发者

Name of backquote character in VB

开发者 https://www.devze.com 2023-03-11 13:47 出处:网络
In System.Windows.Forms.Keys, what is the name of the backquote (`) character? Is backquote not its proper name, o开发者_开发技巧r is it just a quirk of VS?

In System.Windows.Forms.Keys, what is the name of the backquote (`) character? Is backquote not its proper name, o开发者_开发技巧r is it just a quirk of VS?

Or, otherwise, what is its numeric value?


The KeyValue for the character is 223. To check, you can just handle a textbox's keydown event like this:

Private Sub TextBox1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        MessageBox.Show(e.KeyValue.ToString())
End Sub

and press the (`) key. If you want to compare the KeyData, it's under Keys.Oem8.

Edit - As noted in the comments, the KeyValue may change across systems. The enumeration Keys.Oem8 should handle this, so this would be the preferred method of checking if the key is pressed.

0

精彩评论

暂无评论...
验证码 换一张
取 消