RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomForm.SetFocusedControl Method

Sets focus to a control on the form.

Pascal
function SetFocusedControl(Control: TWinControl): Boolean; virtual;
C++
virtual __fastcall Boolean SetFocusedControl(TWinControl * Control);

Use SetFocusedControl to give a control on the form input focus. SetFocusedControl returns false if the Control specified by the Control parameter was already in the process of receiving focus, true otherwise.

Note: A return value of true does not indicate the control has successfully received input focus. If the Control can't have focus (for example, if it is not visible), SetFocusedControl will still return true, indicating that an attempt was made.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!