在非对话框表单上显示帮助问号按钮(biHelp)?
有没有办法可以强制帮助问号按钮在不是 Delphi 2010 对话框的表单上可见?
我想使用帮助问号,以便用户可以单击它然后转到控件,但默认情况下,仅当边框样式为对话框时它才可用,但我们的应用程序不使用对话框表单
我正在查看覆盖 CreateParams程序,但我不确定要在其中放入什么代码来强制显示按钮?
保罗
Is there a way that I can force the help question mark button to be visible on a form that is not a dialog in Delphi 2010?
I want to use the help question mark so that a user can click it then go to a control, but by default it is only available if the border style is dialog, but our application does not use dialog forms
I was looking at Overriding the CreateParams procedure but I am not sure what code to put in it to force the button to show?
Paul
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 MSDN 的说法,这不是 Delphi 特有的限制,而是由 WinAPI 强加的。您可能知道,帮助问号是通过 WS_EX_CONTEXTHELP 样式打开的,该样式不能与 WS_MAXIMIZEBOX 和 WS_MINIMIZEBOX 样式组合使用。因此,您可以拥有一个非对话框表单并显示问号,前提是该表单的标题中没有最大化和最小化按钮。如果您还需要最大化和最小化按钮,那么我认为您应该对窗口进行子类化并提供自定义非客户端绘制(自行绘制问号)和非客户端命中测试处理。
According to MSDN, this is not a Delphi-specific limitation, but it is imposed by WinAPI. As you may know, the help question mark is turned on by WS_EX_CONTEXTHELP style, which cannot be combined with WS_MAXIMIZEBOX and WS_MINIMIZEBOX styles. So you can have a non-dialog form and display the question mark, provided that the form does not have maximize and minimize buttons in its caption. If you need the maximize and minimize buttons as well, then I think you should subclass the window and provide custom nonclient paint (drawing the question mark on your own) and nonclient hit-test processing.
您想要在非模式窗口的顶部(抓取器)非客户区域中出现一个位于最大化和最小化旁边的帮助按钮吗?
在表单上使用 TJvCaptionButton(包含在 JEDI VCL 中),提出帮助问题在控制按钮上标记位图,并从整数帮助上下文中打开特定页面的帮助,如下所示:
因为它在窗口的非客户区域中绘制,所以您可能会遇到某些 Windows 主题设置上出现一些奇怪的行为;例如,我认为 Jedi JvCaptionButtons 在启用了 Aero 的 Win7 上看起来不太原生。
更新下面评论中的链接问题提到将表单置于帮助模式,由 DavidH 贡献:
end;
You want a help button in the top (grabber) non-client area of a non-modal window that appears beside maximize and minimize?
Use TJvCaptionButton (included in the JEDI VCL) on your form, put a help question mark bitmap on the control button, and have that open the help to a particular page, from an integer help context like this:
Because it paints in the non-client area of the window, you might experience some strange behaviour on some Windows theme settings; I don't think Jedi JvCaptionButtons look quite native on Win7 with Aero enabled, for example.
Update The linked question below in comments mentions putting the form into help-mode like this, contributed by DavidH:
end;