procedure TForm1.Button1Click(Sender: TObject); begin
if Webbrowser1.OleObject.Document.Selection.type = 'Control' then
begin
if Webbrowser1.OleObject.Document.Selection.CreateRange.CommonParentElement.tagName =
'IMAGE' then ShowMessage('An Image is selected'); end
else
begin
if Webbrowser1.OleObject.Document.Selection.createRange.Text = '' then ShowMessage('Nothing is selected - '); end; end;