ST3VO
asked on
HTML Preview
Hi all,
I have a project where I've inserted a page tab.
On one tab I have a tab with synedit component where I have the html code.
Now I tried adding EmbeddedWB but the preview was not displying properly as it's got css etc.
So, I was thinking of trying TBrowser? or someother if you know of a better component to use.
To basically I have the code on one tab and when I go the tabsheet2 I need to get the browser component to display the html page.
How is the best way to do this please?
thanks
st3vo
I have a project where I've inserted a page tab.
On one tab I have a tab with synedit component where I have the html code.
Now I tried adding EmbeddedWB but the preview was not displying properly as it's got css etc.
So, I was thinking of trying TBrowser? or someother if you know of a better component to use.
To basically I have the code on one tab and when I go the tabsheet2 I need to get the browser component to display the html page.
How is the best way to do this please?
thanks
st3vo
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
can you access the HTML as a string or stream from synedit ?
here is a complete tutorial on webbrowser
http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_methods.htm
here is a complete tutorial on webbrowser
http://www.cryer.co.uk/brian/delphi/twebbrowser/twebbrowser_methods.htm
ASKER
Yes you can but it just won't render properly
ASKER
Used this code:
Procedure TfrmMain.PageControl1Chang e(Sender: TObject);
begin
if PageControl1.ActivePage=Ta bsheet2 then
Begin
LoadFromStrings(SynEdit1.L ines);
end;
end;
It works but doesn't get any css or render properly.
Procedure TfrmMain.PageControl1Chang
begin
if PageControl1.ActivePage=Ta
Begin
LoadFromStrings(SynEdit1.L
end;
end;
It works but doesn't get any css or render properly.
ASKER
OK here's an update:
Please see code below:
It works (well more or less)
There's a problem with is that when I open an external html file into synedit and THEN try to view it on the design view it does not look right at all.
What could be the difference?
Please see code below:
It works (well more or less)
There's a problem with is that when I open an external html file into synedit and THEN try to view it on the design view it does not look right at all.
What could be the difference?
procedure TfrmMain.PageControl1Change(Sender: TObject);
begin
if PageControl1.ActivePage=Tabsheet2 then
Begin
EmbeddedWB1.LoadFromStrings(SynEdit1.Lines);
end;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Fixed it myself.
ASKER
know what I mean?