Add the combination key and shortcut key (hot key) Call methods of Silverlight to favorites

Source: Internet
Author: User

Add the combination key and shortcut key (hot key) Call methods of Silverlight to favorites

In Silverlight2.0, Silverlight3.0, and Silverlight 4.0, key combinations and shortcuts (hot keys) are very simple.

However, because Silverlight runs in IE, many key combinations and shortcuts (hot keys) are occupied by IE. Unfortunately, there is no solution to block IE.

We can only use limited key combinations and shortcut keys (hotkeys). The following describes how to use them:

Void MainPage_KeyDown (object sender, KeyEventArgs e)
{
ModifierKeys keys = Keyboard. Modifiers;
If (e. Key = Key. G) & keys = ModifierKeys. Control)
{
MessageBox. Show ("You press Ctrl + G! ");
}
}

Hotkey description:

None
No modifier is pressed.

Alt
The Alt key has been pressed.

Control
Press Ctrl.

Shift
The Shift key has been pressed.

Windows
The Windows logo key is pressed.

Apple
The Apple key (also known as the "Open Apple key") has been pressed.

ModifierKeys enumerated values:

Namespace System. Windows. Input
{
// Summary:
// Specifies the set of modifier keys.
[Flags]
Public enum ModifierKeys
{
// Summary:
// No modifiers are pressed.
None = 0,
//
// Summary:
// The ALT key is pressed.
Alt = 1,
//
// Summary:
// The CTRL key is pressed.
Control = 2,
//
// Summary:
// The SHIFT key is pressed.
Shift = 4,
//
// Summary:
// The Windows logo key is pressed.
Windows = 8,
//
// Summary:
// The Apple key (also known as the "Open Apple key") is pressed.
Apple = 8,
}
}

 

This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/dotfun/archive/2010/01/11/5178267.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.