<legend id='DpUKb'><style id='DpUKb'><dir id='DpUKb'><q id='DpUKb'></q></dir></style></legend>

    <tfoot id='DpUKb'></tfoot>

  1. <small id='DpUKb'></small><noframes id='DpUKb'>

    • <bdo id='DpUKb'></bdo><ul id='DpUKb'></ul>
    <i id='DpUKb'><tr id='DpUKb'><dt id='DpUKb'><q id='DpUKb'><span id='DpUKb'><b id='DpUKb'><form id='DpUKb'><ins id='DpUKb'></ins><ul id='DpUKb'></ul><sub id='DpUKb'></sub></form><legend id='DpUKb'></legend><bdo id='DpUKb'><pre id='DpUKb'><center id='DpUKb'></center></pre></bdo></b><th id='DpUKb'></th></span></q></dt></tr></i><div id='DpUKb'><tfoot id='DpUKb'></tfoot><dl id='DpUKb'><fieldset id='DpUKb'></fieldset></dl></div>
    1. 如何检测 WPF 中的修饰键状态?

      How to detect modifier key states in WPF?(如何检测 WPF 中的修饰键状态?)
        <bdo id='sbuEs'></bdo><ul id='sbuEs'></ul>
        <legend id='sbuEs'><style id='sbuEs'><dir id='sbuEs'><q id='sbuEs'></q></dir></style></legend>

        <small id='sbuEs'></small><noframes id='sbuEs'>

        <i id='sbuEs'><tr id='sbuEs'><dt id='sbuEs'><q id='sbuEs'><span id='sbuEs'><b id='sbuEs'><form id='sbuEs'><ins id='sbuEs'></ins><ul id='sbuEs'></ul><sub id='sbuEs'></sub></form><legend id='sbuEs'></legend><bdo id='sbuEs'><pre id='sbuEs'><center id='sbuEs'></center></pre></bdo></b><th id='sbuEs'></th></span></q></dt></tr></i><div id='sbuEs'><tfoot id='sbuEs'></tfoot><dl id='sbuEs'><fieldset id='sbuEs'></fieldset></dl></div>

        • <tfoot id='sbuEs'></tfoot>

              <tbody id='sbuEs'></tbody>

              1. 本文介绍了如何检测 WPF 中的修饰键状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                是否有一些全局结构可以在我需要访问 Control、Shift、Alt 按钮是否按下时使用?例如在 TreeViewMouseDown 事件中.

                Is there some global constructs that I can use whenever I need to access whether the Control, Shift, Alt buttons are down? For instance inside MouseDown event of a TreeView.

                如果有怎么办?

                推荐答案

                使用类键盘.使用 Keyboard.IsKeyDown 现在可以检查 Control、Shift、Alt 是否关闭.

                Use class Keyboard. Using Keyboard.IsKeyDown you can check if Control, Shift, Alt is down now.

                换班:

                if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
                { /* Your code */ }
                

                对于控制:

                if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
                { /* Your code */ }
                

                对于 Alt:

                if (Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt))
                { /* Your code */ }
                

                这篇关于如何检测 WPF 中的修饰键状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                Accessing attribute info from DTE(从 DTE 访问属性信息)
                c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                How can I force the PropertyGrid to show a custom dialog for a specific property?(如何强制 PropertyGrid 显示特定属性的自定义对话框?)
                Associate attribute with code generated property in .net(将属性与 .net 中的代码生成属性相关联)
              2. <legend id='cV50K'><style id='cV50K'><dir id='cV50K'><q id='cV50K'></q></dir></style></legend>

                    <small id='cV50K'></small><noframes id='cV50K'>

                    <i id='cV50K'><tr id='cV50K'><dt id='cV50K'><q id='cV50K'><span id='cV50K'><b id='cV50K'><form id='cV50K'><ins id='cV50K'></ins><ul id='cV50K'></ul><sub id='cV50K'></sub></form><legend id='cV50K'></legend><bdo id='cV50K'><pre id='cV50K'><center id='cV50K'></center></pre></bdo></b><th id='cV50K'></th></span></q></dt></tr></i><div id='cV50K'><tfoot id='cV50K'></tfoot><dl id='cV50K'><fieldset id='cV50K'></fieldset></dl></div>
                        • <bdo id='cV50K'></bdo><ul id='cV50K'></ul>
                          <tfoot id='cV50K'></tfoot>
                            <tbody id='cV50K'></tbody>