zoukankan      html  css  js  c++  java
  • Silverlight的组合键、快捷键(热键)调用方法

    在Silverlight2.0、Silverlight3.0、Silverlight 4.0版本中实现组合键、快捷键(热键)是非常简单的。

    但是由于Silverlight是运行于IE之中,所以很多组合键、快捷键(热键)都被IE占用,很遗憾目前还没有阻止IE的方案。

    我们只能使用有限的组合键、快捷键(热键),以下是使用方法:

    void MainPage_KeyDown(object sender, KeyEventArgs e)
    {
        ModifierKeys keys = Keyboard.Modifiers;
        if ((e.Key == Key.G) && keys == ModifierKeys.Control)
        {
            MessageBox.Show("你按下了Ctrl+G组合键!");
        }
    }

    热键说明:

    None
    没有按下任何修饰符。

    Alt
    Alt 键已按下。

    Control
    Ctrl 键已按下。

    Shift
    Shift 键已按下。

    Windows
    Windows 徽标键已按下。

    Apple
    Apple 键(也称作"Open Apple 键")已按下。

    ModifierKeys 枚举值:

    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,
        }
    }

  • 相关阅读:
    GridView 应用貌似是个mm写的,值得尊敬!
    .net 时间函数
    .net 获取url的方法
    SaveGraphics
    asp网站页面上都是问号
    由于编码方式导致CSS样式表失效
    .net url乱码
    常用正则表达式
    解决realse版在加载toolbar后不正常退出的现象
    general error c1010070: Failed to load and parse the manifest
  • 原文地址:https://www.cnblogs.com/slteam/p/1644444.html
Copyright © 2011-2022 走看看