procedure TForm_main.ShowBlankPage(WebBrowser:TWebBrowser);
var
URL: OleVariant;
begin
URL:='about:blank';
WebBrowser.Navigate2(URL,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
end;
procedure TForm_main.LoadHTML(WebBrowser: TWebBrowser; const htmltxt:string);
var
Strm: TstringStream;
begin
ShowBlankPage(WebBrowser); '
WebBrowser.Show;
while WebBrowser.ReadyState < READYSTATE_INTERACTIVE do Application.ProcessMessages;
if Assigned(WebBrowser.Document) then
begin
Strm := TstringStream.Create(htmltxt);
try
Strm.Seek(0, 0);
(WebBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(Strm));
finally
Strm.Free;
end;
end;
end;