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

  • <legend id='QFhdQ'><style id='QFhdQ'><dir id='QFhdQ'><q id='QFhdQ'></q></dir></style></legend>
    1. <i id='QFhdQ'><tr id='QFhdQ'><dt id='QFhdQ'><q id='QFhdQ'><span id='QFhdQ'><b id='QFhdQ'><form id='QFhdQ'><ins id='QFhdQ'></ins><ul id='QFhdQ'></ul><sub id='QFhdQ'></sub></form><legend id='QFhdQ'></legend><bdo id='QFhdQ'><pre id='QFhdQ'><center id='QFhdQ'></center></pre></bdo></b><th id='QFhdQ'></th></span></q></dt></tr></i><div id='QFhdQ'><tfoot id='QFhdQ'></tfoot><dl id='QFhdQ'><fieldset id='QFhdQ'></fieldset></dl></div>
      1. <tfoot id='QFhdQ'></tfoot>
        • <bdo id='QFhdQ'></bdo><ul id='QFhdQ'></ul>

        WPF:当 IsEnabled=false 时获取 MouseEnter 事件

        WPF: Get MouseEnter Event When IsEnabled=false(WPF:当 IsEnabled=false 时获取 MouseEnter 事件)

            <legend id='9Odfy'><style id='9Odfy'><dir id='9Odfy'><q id='9Odfy'></q></dir></style></legend>

            <small id='9Odfy'></small><noframes id='9Odfy'>

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

                <tfoot id='9Odfy'></tfoot>
                  <tbody id='9Odfy'></tbody>

                  本文介绍了WPF:当 IsEnabled=false 时获取 MouseEnter 事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当控件被禁用时,我想为自定义控件处理 MouseEnter 事件.有没有办法处理它?

                  I want to handle MouseEnter event for a Custom Control when control is disabled. Is there a way to handle it?

                  推荐答案

                  UIElement.IsEnabled 记录了您看到的行为:

                  The documentation for UIElement.IsEnabled documents the behaviour you see:

                  未启用的元素不参与命中测试或焦点,因此不会成为输入事件的来源.

                  Elements that are not enabled do not participate in hit testing or focus and therefore will not be sources of input events.

                  对我来说,合乎逻辑的结论是,如果您确实想处理鼠标事件,则不要禁用控件.相反,请使用其他方法来实现您想要的.例如,如果它是一个输入控件,将其设为只读而不是禁用可能就足够了.您的问题并没有真正解释您为什么要这样做,所以我无法猜测适合您的方法是什么.

                  The logical conclusion, to me, is that if you do want to handle mouse events, you don't disable the control. Instead, use some other method of achieving what you want. For example, if it's an input control, it may be good enough to make it read-only instead of disabled. Your question doesn't really explain why you want this, so I cannot guess what the right method for you will be.

                  这篇关于WPF:当 IsEnabled=false 时获取 MouseEnter 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                  Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                  Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                  IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                  .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                  Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)
                1. <i id='Co7ND'><tr id='Co7ND'><dt id='Co7ND'><q id='Co7ND'><span id='Co7ND'><b id='Co7ND'><form id='Co7ND'><ins id='Co7ND'></ins><ul id='Co7ND'></ul><sub id='Co7ND'></sub></form><legend id='Co7ND'></legend><bdo id='Co7ND'><pre id='Co7ND'><center id='Co7ND'></center></pre></bdo></b><th id='Co7ND'></th></span></q></dt></tr></i><div id='Co7ND'><tfoot id='Co7ND'></tfoot><dl id='Co7ND'><fieldset id='Co7ND'></fieldset></dl></div>

                  <legend id='Co7ND'><style id='Co7ND'><dir id='Co7ND'><q id='Co7ND'></q></dir></style></legend>
                2. <tfoot id='Co7ND'></tfoot>

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

                          <tbody id='Co7ND'></tbody>
                          <bdo id='Co7ND'></bdo><ul id='Co7ND'></ul>