Dear Delphians,
When you click on the questionmark button, the mouse cursor becomes a
question mark with an arrow. This indicates that the application has
switched to context sensitive help mode. When you click on a control with
this help cursor, Delphi displays the help topic for it (if there is a
matching help topic). So it should be, but not always is...
I did all according to the rules: When using F1 I set BorderIcons to
[biSystemMenu], while when using the questionmark button I set BorderIcons
to [biSystemMenu,biHelp], BorderStyle = bsDialog in both cases. The F1
worked perfectly well, but I wanted the help topic being displayed in a
popup window, not in a standard help window. So I changed BorderIcons values
and assigned the help context number to the proper control. And nothing
happened! Sure, I got the questionmark button click on the window caption, I
was clicking on it, every time I did it the cursor became a question mark
with an arrow, but when I clicked on the proper control - NOTHING HAPPENED!
I'm pretty sure that the help mode was not being activated at all, because
the forms OnHelp event was being raised only when using F1 but not when
using the questionmark button (I had written a dummy OnHelp handler just to
check if the event was raised).
So I wrote an OnClick handler for the control with only one command:
Application.HelpCommand(HELP_CONTEXT,TopicNumber) and went back to the
window with no questionmark button. And it worked, generating an OnHelp
event and displaying the standard help window. Yet when I changed
HELP_CONTEXT to HELP_CONTEXTPOPUP to get a popup window it stoped working!
Then I put the questionmark button on the window again and changed the
command by making it depend on the cursor:
if Cursor = crHelp then
Application.HelpCommand(HELP_CONTEXT,TopicNumber)
But though the cursor on the screen realy turned to a question mark with an
arrow, the cursors value did not change, the command was never put in
action. And no help window was displayed. Isn't this crazy?!
I just want the context sensitive help on my window with no tricks, just
using the functionality of Delphi 5, that is what I had paid for, isn't
that? Could you, please, tell me, what I'm doing wrong?
Wojtek Niwinski
wojt...@swipnet.se
PS Please, mail the answer to my address as well.