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

  • 相关阅读:
    css flex布局实现后台页面
    html5 css iframe实现后台框架,仅用于学习案例
    nginx 多个网站配置
    nginx 负载 访问时 去掉端口
    nginx 负载
    解标准数独算法
    C++ execute linux cmd and retrieve the output
    C++ generate in Ubuntu
    shell操作典型案例--FTP操作
    PHP7 新写法
  • 原文地址:https://www.cnblogs.com/slteam/p/1644444.html
Copyright © 2011-2022 走看看