如何在禁用的控件上显示工具提示? [英] how to show a tooltip on a disabled control?

查看:26
本文介绍了如何在禁用的控件上显示工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在显示一个按钮列表,其中一些可能被禁用.我需要在禁用的按钮上显示一个工具提示,并解释为什么它被禁用,但似乎我无法在不禁用工具提示的情况下禁用该按钮.有没有简单的方法可以解决这个问题?

I'm displaying a list of buttons, some of which might be disabled. I need to show a tooltip on the disabled buttons with an explanation of why it's disabled, but it seems I can't disable the button without disabling the tooltip. Is there a simple way around this?

推荐答案

将 Button 包裹在一个组中,并将工具提示应用于该组.

Wrap the Button in a Group, and apply the toolTip to the group instead.

<s:Group toolTip="My toolTip">
    <s:Button enabled="false"/>
</s:Group>

有点难看,但很管用.

这篇关于如何在禁用的控件上显示工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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