0

I have custom control (Numeric TextBox- which allows only numeric keys). When i am pressing subtract key from NumPad, it's working fine. But when i am pressing OemMinus key(key near to '0'[DPad key]), OnKeyDown event returns 'unknown' key.

I want to handle OemMinus Key.

Thanks

4

1 回答 1

0

I guess that this key cannot be identified because it is platform specific. ie it only appears on Windows keyboards (as distinct from Mac keyboards). Silverlight is cross-platform.

You should be able to identify the key using the KeyEventArgs.PlatformKeyCode property, but note that this is platform specific.

Perhaps you can check for (e.Key == Key.Unknown && e.PlatformKeyCode == x)

于 2013-02-06T20:12:00.060 回答