覆盖标题栏按钮的工具提示文本(关闭、最大化、最小化、帮助) [英] Override tooltip text for Titlebar buttons (Close, Maximize, Minimize, Help)

查看:21
本文介绍了覆盖标题栏按钮的工具提示文本(关闭、最大化、最小化、帮助)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试更改为表单主标题栏上的按钮显示的工具提示文本,但没有成功.

I have been trying without luck to change the text of the tooltip that appears for the buttons on the main title bar of a form.

简而言之,我们利用 Windows 窗体的帮助"按钮来实现其他目的.这工作正常.问题是将鼠标悬停在该按钮上时,会出现帮助"工具提示,这对应用程序没有任何意义.

In a nutshell, we have harnessed the 'Help' button for Windows Forms to have some other purpose. This is working fine. The issue is that when hovering the mouse over that button, a 'Help' tooltip appears, which doesn't make any sense for the application.

理想情况下,可以通过某种方式为我的应用程序更改该工具提示的文本;然而,在这一点上,只要找到一种完全禁用工具提示的方法,我就会感到满意.

Ideally, there would be some way to change the text of that tooltip for my application; however, at this point I would be satisfied just finding a way to disable the tooltips altogether.

我知道您可以通过修改 regedit 中的UserPreferencesMask"键来禁用整个操作系统的工具提示,但我真的希望有一种方法可以让这仅影响我的应用程序.

I know that you can disable the tooltips for the entire OS by modifying the 'UserPreferencesMask' key in regedit, but I would really like a way to have this only affect my application.

同样,理想情况下会有一些方法可以使用托管代码来做到这一点,但我不反对链接到 Windows API 或类似的东西.

Again, ideally there would be some way to do this with managed code, but I would not be opposed to linking into the Windows API or the like.

感谢您提供解决此问题的任何建议!

Thanks for any suggestions for resolving this issue!

推荐答案

作为一种解决方法,您可能不使用帮助按钮,而是:添加您的自定义按钮.

As a workaround, you may not use the help button, instead: add your custom button.

虽然这个示例不是那么完美,但它向你展示了这个想法.

Although this sample not so perfect, but it shows you the idea.

这篇关于覆盖标题栏按钮的工具提示文本(关闭、最大化、最小化、帮助)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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