如何显示禁用控件的工具提示?

编程入门 行业动态 更新时间:2024-10-28 10:24:46
本文介绍了如何显示禁用控件的工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

更多推荐

如何显示禁用控件的工具提示?

本文发布于:2023-11-03 16:58:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555626.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   提示   工具

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!