![]() |
Previous Top Next |
FormHelp component.
|
type
|
TWhatsThisEvent = procedure(Sender: TObject; HelpControl: TControl; MousePos: TPoint; var ShowPopup, ShowHelp: Boolean) of object;
|
|
property OnWhatsThis: TWhatsThisEvent;
|
The OnWhatsThis event occurs when user clicks right mouse button (right clicks) on the control with context-sensitive help in the secondary part of Hint property.
|
|
Use HelpControl parameter to get pointer to control from wich with the context-sensitive help was taken. The coordinates where user clicks the mouse button passed with MousePos parameter.
|
|
If you don't want to invoke the "What's This ?" popup menu for some certain controls make ShowPopup parameter False in the event handler (see example below). However, even if you don't want to show the popup menu but still would like to show the context-sensitive help, then make ShowHelp parameter True.
|
procedure TForm1.FormHelp1WhatsThis(Sender: TObject;
|
HelpControl: TControl; MousePos: TPoint; var ShowPopup,
|
ShowHelp: Boolean);
|
begin
|
if HelpControl is TLabel then
|
begin
|
ShowPopup := False; // don't invoke "What's This?" for all labels
|
if HelpControl = Label1 then
|
ShowHelp := True; // show the context-sensitive help for "Label1" on right click
|
end;
|
end;
|
WhatsThis structure.
|