WPF 工具提示可见性 [英] WPF Tooltip Visibility

查看:31
本文介绍了WPF 工具提示可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确保按钮的工具提示仅在按钮禁用时可见?

How can I ensure that a button's Tooltip is only visible when the button is disabled?

我可以将工具提示的可见性绑定到什么?

What can I bind the tooltip's visibility to?

推荐答案

您需要设置 ToolTipService.ShowOnDisabled 在按钮上设置为 True,以便在按钮被禁用时让工具提示完全可见.您可以将 ToolTipService.IsEnabled 绑定到按钮来启用和禁用工具提示.

You will need to set ToolTipService.ShowOnDisabled to True on the Button in order to have the Tooltip visible at all when the Button is disabled. You can bind ToolTipService.IsEnabled on the Button to enable and disable the Tooltip.

这篇关于WPF 工具提示可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆