工具提示保留 [英] Tooltip Retain

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

问题描述

即使主窗口失去焦点,也要保留工具提示。目前我正在显示验证消息的工具提示,我在其中绘制自定义矩形以显示消息,但当主窗口失去焦点时,此工具提示将被隐藏。

Retain tooltip even if the main window loses focus. Currently i'm showing tooltip for validation messages where I draw custom rectangle to show message, but this tooltip is hidden when main window loses the focus.

推荐答案

嗨Harish,

Hi Harish,

欢迎使用Windows窗体论坛。

Welcome to Windows Form Forum.

>>即使主窗口失去焦点,也要保留工具提示

>>Retain tooltip even if the main window loses focus

我很抱歉不知道你想做什么,据我所知,工具提示用于控制而不是窗口, 和  ;当控件失去焦点时,它会真正隐藏,即使你的鼠标总是在控件上,它也会隐藏,这意味着
默认情况下你无法一直显示它。

I'm sorry not sure what do you want to do, as far as I know, tooltip is used to controls instead of windows, and it will really hide when the control loses focus, it will also hide even if your mouse is always on the control, that means you can not show it all the time by default.

如果你的意思是你想要一直保留工具提示,你可以使用计时器来模拟它,请查看以下代码:

If your meaning is that you want to retain tooltip all the time, you can use a timer to simulate it, please view the following code:

        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Interval = 30000;
            timer1.Start();

            toolTip1.AutoPopDelay = 30000;
            toolTip1.InitialDelay = 1;
            toolTip1.ReshowDelay = 10;

            toolTip1.ShowAlways = true;

            toolTip1.SetToolTip(this.button1, "hello Harish");
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            toolTip1.Active = false;
            toolTip1.Active = true;
        }

希望这会有所帮助!

Hope this helps!

最好的问候,

Stanly


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

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