THtmlViewer, TFrameViewer, and TFrameBrowser components
property OnObjectClick: TObjectClickEvent;
The OnObjectClick event occurs when the mouse is left clicked on an Object. Currently, all Form controls support this event. See the TObjectClickEvent type for information on the parameters.
The following handler will display the status of radio buttons and checkboxes whenever they are changed. Display only occurs for those controls having the OnClick="display" attribute:
procedure TForm1.ObjectClick(Sender, Obj: TObject; const OnClick: String);
var
S: string;
begin
if OnClick = 'display' then
begin
if Obj is TFormControlObj then
with TFormControlObj(Obj) do
begin
if TheControl is TCheckBox then
with TCheckBox(TheControl) do
begin
S := Value + ' is ';
if Checked then S := S + 'checked'
else S := S + 'unchecked';
MessageDlg(S, mtCustom, [mbOK], 0);
end
else if TheControl is TRadioButton then
with TRadioButton(TheControl) do
begin
S := Value + ' is checked';
MessageDlg(S, mtCustom, [mbOK], 0);
end;
end;
end;
end;
See also: