Delphi Sources

Получить выделенные объекты из TWebBrowser



Оформил: DeeCo

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;

Copyright © 2004-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте