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
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.
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:
Application.HelpContext(aHelpContext);
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:
SendMessage(Handle, WM_SYSCOMMAND, SC_CONTEXTHELP, 0);
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With