procedure TMyForm.ToolButton1Click(Sender: TObject);
if Assigned(ActiveControl) then begin
Hi David its fine now this worked, I just had to write some code that goes back up the control's hierarchy. We use DevExpress grids, so the active control in my case was a cell in the grid, I needed to go back up to the parent, i.e. the grid
I tested the code when I wrote the answer. It works. There must be something unusual in your app.
I think you need a tool button OnClick handler that can be as simple as this:
Thanks this works in terms of bringing up the help system. However, the help button is on the toolbar of the main form. When I use this code, the help system is called with the help for the form which is being viewed, even though I have focus in a control that has its own context sensitive help? If I am on the grid and press F1 I get help for the grid
What makes this work is the fact that the controls on a toolbar do not ever become the active control.