IDControl Property


Applies to

THtmlViewer component

Declaration

property IDControl[const ID: string]: TObject;

Read only and run time only. The IDControl Property provides an easy way to get the instance handle of a Form control or image using the ID attribute defined in the control's HTML tag.

For a hidden form control the return is of type THiddenFormControlObj.

Example:

In the following, clicking Button1 checks the RadioButton control with the ID, "Rad1"

procedure TForm1.Button1Click(Sender: TObject);

var

Obj: TObject;

begin

Obj := Viewer.IDControl['Rad1'];

if (Obj is TRadioButton) then

TRadioButton(Obj).Checked := True;

end;

See Also:

FormControlList Property

FormData Property

OnFormSubmit Event