Vcl.Forms.TCustomForm.SetFocusedControl

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SetFocusedControl(Control: TWinControl): Boolean; virtual;

C++

virtual bool __fastcall SetFocusedControl(Vcl::Controls::TWinControl* Control);

Properties

Type Visibility Source Unit Parent
function public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TCustomForm

Description

Sets focus to a control on the form.

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.

See Also