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

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

问题描述

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

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?

推荐答案

将按钮包装到一个组中,并将该工具提示应用于该组。 / p>

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's a bit ugly, but it works.

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

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