在 winforms 应用程序中以编程方式显示工具提示 [英] Programmatically show tooltip in winforms application

查看:21
本文介绍了在 winforms 应用程序中以编程方式显示工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以编程方式使控件的工具提示显示在 Winforms 应用程序中,而无需将鼠标悬停在控件上?(如有必要,P/Invoke 是可以的).

How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary).

推荐答案

如果你在表单上使用 Tooltip 控件,你可以这样做:

If you are using the Tooltip control on the form, you can do it like this:

ToolTip1.Show("Text to display", Control)

工具提示控件的 MSDN 文档"Show"方法对此有各种不同的变体以及如何使用它们.

The MSDN documentation for the ToolTip control's "Show" method has all the different variations on this and how to use them.

这篇关于在 winforms 应用程序中以编程方式显示工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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