Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Fett/Kursiv/Unterstrichen im WebBrowser (https://www.delphipraxis.net/68446-fett-kursiv-unterstrichen-im-webbrowser.html)

Hansi 29. Apr 2006 17:56


Fett/Kursiv/Unterstrichen im WebBrowser
 
Hey,

Kann mir jemand einen Tip geben wie ich direkt im WebBrowser den selektierten Text Fett usw machen kann?

MfG
Hansi

fkerber 29. Apr 2006 18:04

Re: Fett/Kursiv/Unterstrichen im WebBrowser
 
Hi!

Lies mal hier nach, da findest du sicherlich etwas:
http://www.dataweb.de/articles/mshtm...mlediting.html


Ciao Frederic

Hansi 29. Apr 2006 18:13

Re: Fett/Kursiv/Unterstrichen im WebBrowser
 
So sieht die Lösung aus:

Delphi-Quellcode:
...
private
    { Private-Deklarationen }
  function GetHTMLDocument2Ifc: IHTMLDocument2;
  protected
    property HTMLDocument2Ifc: IHTMLDocument2 read GetHTMLDocument2Ifc;
  public
    { Public-Deklarationen }
  end;

...

function TForm1.GetHTMLDocument2Ifc: IHTMLDocument2;
begin
  Result := WebBrowser1.Document as IHTMLDocument2;
end;

...

procedure TForm1.ToolButton1Click(Sender: TObject);
begin
  HTMLDocument2Ifc.execCommand('Bold', False, 0);
end;
Vielen Dank Frederic!


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz