C#工具提示没有出现"显示" [英] C# Tooltip not appearing on "Show"

查看:175
本文介绍了C#工具提示没有出现"显示"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要fullfill要求我必须手动显示工具提示30秒。根据MSDN我只需要使用显示方法

To fullfill a requirement I have to show a tooltip manually for 30 seconds. According to msdn I just have to use the "Show" method.

toolTip.Show(QuestionHelpText, btnHelp, 30000);



但我只得到标准工具提示的行为,也就是说,出现的消息我的点击后半秒(只是因为鼠标指针仍然高于按钮)。我试着像

But I only get the standard tooltip behavior, meaning that the message appears half a second after my click (only because the mouse pointer is still over the button). I tried some variations like

toolTip.Show(QuestionHelpText, btnHelp);



但仍然没有任何反应。

but still, nothing happens.

没有任何人有一个想法,这是为什么?

Does anybody have an idea why that is?

感谢

推荐答案

我知道一个简单的解决方法

I know a simple workaround

将一个标贴(让我们将其命名为 labelHelp )与您的按钮

Put a lable (let's name it labelHelp) with empty text near your button

下面的代码应该工作

    private void btnHelp_Click(object sender, EventArgs e)
    {
        toolTip.Show(QuestionHelpText, labelHelp, 3000);
    }

这篇关于C#工具提示没有出现"显示"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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