windows Delphi 中的窗口和提示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1078179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Windows and Hints in Delphi
提问by HX_unbanned
This morning I finally made my mind and decided to ask you for help. Problem is that in my Delphi application no hints are shown at all... I have read about THintAction problem, I have read guides/tutorials/manuals, tried to invoke Hint windows ( firing event handlers ) manually, but nothing worked. They just doesnt show. I have run out of ideas ...
今天早上我终于下定决心,决定向你求助。问题是在我的 Delphi 应用程序中根本没有显示任何提示......我已经阅读了 THintAction 问题,我已经阅读了指南/教程/手册,尝试手动调用提示窗口(触发事件处理程序),但没有任何效果。他们只是不显示。我已经没有想法了......
I have tried to: setting parent showhints on components, forms, from event handlers, application activatehint() ...
我曾尝试:在组件、表单、事件处理程序、应用程序 activatehint() 上设置父显示提示...
Is there any other way to do this ( except API calls, of course )?
有没有其他方法可以做到这一点(当然,API 调用除外)?
采纳答案by Roee Adler
First, what version of Delphi do you use?
首先,您使用什么版本的Delphi?
Second, I recommend you try creating a simple application from scratch, with just one form and say a tool-button (or any other control that can show hints), with ShowHints activated, and see if it shows. If on such a very simple app you'll get no hints, I would recommend reinstalling Delphi, maybe something in your installation is screwed up...
其次,我建议您尝试从头开始创建一个简单的应用程序,只有一个表单并说一个工具按钮(或任何其他可以显示提示的控件),激活 ShowHints,看看它是否显示。如果在这样一个非常简单的应用程序上你不会得到任何提示,我建议重新安装 Delphi,也许你的安装中的某些东西被搞砸了......
回答by utku_karatas
I bet you're on XP and your installation is rather old.
我敢打赌您使用的是 XP 并且您的安装相当旧。
A friend of mine had this exact problem in his machine. No VCL hints were showing up in his machine. That includes the apps he built, the Delphi IDE he used (7 afaicr) and any other Delphi built app he had on his machine. So we had concluded by blaming his WinXP instance which has been on the run for the last 2 years with a lot of garbage in it (most likely it was some app he installed sometime that was hooking messages at some point causing this weird behaviour). It might be your case as well.
我的一个朋友在他的机器上遇到了这个问题。他的机器上没有出现 VCL 提示。这包括他构建的应用程序、他使用的 Delphi IDE (7 afaicr) 以及他机器上的任何其他 Delphi 构建的应用程序。因此,我们得出结论,归咎于他的 WinXP 实例,该实例在过去 2 年中一直在运行,其中包含大量垃圾(很可能是他有时安装的某个应用程序在某些时候挂钩消息导致了这种奇怪的行为)。这也可能是你的情况。
ps. Another interesting point - the hints were showing up if you set Application.HintPause to a low value like 100-200. You may want to try that as well.
附:另一个有趣的点 - 如果将 Application.HintPause 设置为 100-200 等低值,则会显示提示。您可能也想尝试一下。
回答by John Mills
I've just had this problem on Delphi-5, "run-time application won't display hints on mouse-hover". It works fine on my other applications.
我刚刚在 Delphi-5 上遇到了这个问题,“运行时应用程序不会在鼠标悬停时显示提示”。它在我的其他应用程序上运行良好。
I've traced it to the following: Project|Options|Compiler|Debugging|Use Debug DCUs This was checked, unchecking and re-compiling enables my hints.
我已将其追溯到以下内容:项目|选项|编译器|调试|使用调试 DCU 这已被选中,取消选中并重新编译会启用我的提示。
回答by Lieven Keersmaekers
Have you tried adding Application.ShowHint to your project file?
您是否尝试将 Application.ShowHint 添加到您的项目文件中?
The project file would then look something like this
项目文件看起来像这样
begin
Application.Initialize;
Application.ShowHint := True;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.
回答by Daniel Rikowski
A few tips:
一些提示:
- Check if you or another component/unit has set a custom hint class. If so, find that component/unit and remove it.
- Compile your application with Debug DCUs and put breakpoints at the appropriate places in Forms.pas. Then single-step through the code and see what happens.
- 检查您或其他组件/单元是否设置了自定义提示类。如果是这样,找到该组件/单元并将其删除。
- 使用调试 DCU 编译您的应用程序,并在 Forms.pas 中的适当位置放置断点。然后单步执行代码,看看会发生什么。
回答by HX_unbanned
Okay - As I Recently Upgraded to 2010 version ( 14.x ), I finally was sure that this Hint problem is Bug in the IDE.
好的 - 由于我最近升级到 2010 版本(14.x),我终于确定这个提示问题是 IDE 中的错误。
Only solutions is: - change the HintPause property - try to reinstall IDE
唯一的解决方案是: - 更改 HintPause 属性 - 尝试重新安装 IDE