getControlByName

getControlByName(controlName: String): Control;

The getControlByName method of the Form class returns the control on the form with the name specified by the value of the controlName parameter. If the control is not on the form, a null value is returned.

The following example shows the use of the getControlByName method.

vars
    frm: BingSearch;
    control: Control;
begin
    create frm;
    control := frm.getControlByName("btnSearch");
    write control;
epilog
    delete frm;
end;