wpf - Ignoring Button Clicks without Disabling Button
问题描述
I'm looking for a way to ignore clicks on a Button
without actually flipping it to IsEnabled="False"
since disabling the button lightens it, making it inconsistent with the rest of my UI. Is this possible? Or is it perhaps possible to override the lightened style that is applied for that single button when disabled?
解决方案
有一个IsHitTestVisible
属性可以设置为False
:
<Button Content="..." IsHitTestVisible="False" />
这将使Button
“不可点击”。
推荐阅读
- css - 定位嵌套层次结构时,CSS :not() 选择器不起作用
- java - Windows 节能后网络共享上的 Java 应用程序停止工作
- javascript - 如何通过使用 Ramda 将谓词映射到输入数组来获取两个数组
- linux - 解释基本的 ARM 指令
- r - 带有 for 循环和变量创建的函数
- sql - XMLTABLE 后的聚合函数返回空结果集
- c++ - 递归可变参数模板函数 - 没有歧义?
- zend-framework3 - zf3 视图没有找到助手
- windows - 如何为自定义 nsis 安装程序添加边框
- c++ - make: *** 没有规则来制作目标 'agenda.cpp','agenda' 需要。停止。#制作Makefile