fh2
asked on
Removing Focus
How can I remove focus from a button in Delphi 5?
and also try to find the tabstop property of the button in the object inspector and set that to false
I mean
button1.tabstop:=false;
I mean
button1.tabstop:=false;
use the following:
Windows.SetFocus(0);
It removes the focus from the control but does not set the focus to any other control in the window.
Regards
Pierre
Windows.SetFocus(0);
It removes the focus from the control but does not set the focus to any other control in the window.
Regards
Pierre
Or use TSpeedButton: it never get the Focus ;-))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Place a button somewhere on your form where it can't be seen:
FocusButton1.Left :=-1000;
FocusButton1.Top :=-1000;
And if you want to loose the focus of any button call:
FocusButton1.SetFocus
This will focus the FocusButton1 (as it's still visible, you won't get an error)...
Good luck!
Evarest