# Type TObjectClickEvent

## Declaration

TObjectClickEvent = procedure(Sender, Obj: TObject; const OnClick: string) of Object;

## Description

The TObjectClickEvent type is the type for OnObjectClick events. These events occur when the mouse is clicked on an Object.

In the above, Sender is the THtmlViewer where the Object is located and Obj is a pointer to the clicked object. OnClick is the string assigned to the OnClick attribute of the object's HTML tag.

Form controls currently support the OnObjectClick event. These objects are descendents of TFormControlObj. In particular, the TheControl property can give access to the underlying Delphi controls, such as TButton, TRadiobutton, and TCheckbox with code similar to:

    if (Obj is TFormControlObj) then
        with TFormControlObj(Obj) do
            if (TheControl is TButton) then
                .....

TFormControlObj's base class THtmlNode also has an AttributeValue Property with which special user attributes can be accessed:

    if (Obj is THtmlNode) then
        AttrValue := THtmlNode(Obj).AttributeValue['MyAttr'];

See also:

OnObjectClick Event

OnImageClick Event