将工具提示设置为C#中的禁用复选框 [英] Set tooltip to disabled checkbox in C#

查看:112
本文介绍了将工具提示设置为C#中的禁用复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好专家,

我正在运行时创建复选框n为其分配了工具提示..afterword被禁用了..所以我的困难是它不向该禁用的复选框显示工具提示.

我正在使用WPF n C#

谢谢,

Hello Experts,

I am creating checkbox at runtime n assigning tooltip to it..afterword it gets disabled..So my difficulty is it doesnot show tooltip to that disabled checkbox.

I am workingg with WPF n C#

Thanks,

推荐答案

看看 WPF中的工具提示 [^ ]
Have a look at ToolTips in WPF[^]
如何在禁用的控件上显示ToolTips

当您使用IsEnabled=False禁用控件时,工具提示将不再显示.如果仍要显示工具提示,则必须将附加属性ToolTipService.ShowOnDisabled设置为True.

How to show ToolTips on disabled controls

When you disable a control with IsEnabled=False the tool tip does not show any more. If you want to have the tool tip appear anyway you have to set the attached property ToolTipService.ShowOnDisabled to True.

<button isenabled="False">
        ToolTip="Saves the current document"
        ToolTipService.ShowOnDisabled="True"
        Content="Save">
</button>



您无法做到的-除非用户可以更改关联的控件,否则不会显示工具提示.
AFAIK you can''t - tooltips never show unless the associated control can be changed by the user.


它"不是虫子;这是一个功能^^
It''s not a bug ; it''s a feature ^^


这篇关于将工具提示设置为C#中的禁用复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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