Solved

HTML Preview

Posted on 2009-05-06
8
462 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:ST3VO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 
LVL 8

Assisted Solution

by:BdLm
BdLm earned 50 total points
ID: 24312573
use the TWebbrowser , TWebbrowers.navigate(myfile.html)

0
 

Author Comment

by:ST3VO
ID: 24312597
But there's no myfile.html because I type the html code on the synedit component/page and when I change the tab to where the web browser component is I need it to preview my code.

know what I mean?
0
 
LVL 8

Expert Comment

by:BdLm
ID: 24312615
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 
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ST3VO
ID: 24312647
Yes you can but it just won't render properly
0
 

Author Comment

by:ST3VO
ID: 24312669
Used this code:

Procedure TfrmMain.PageControl1Change(Sender: TObject);
begin
if PageControl1.ActivePage=Tabsheet2 then
   Begin
 
     LoadFromStrings(SynEdit1.Lines);
   
   end;
end;

It works but doesn't get any css or render properly.

0
 

Author Comment

by:ST3VO
ID: 24312806
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?


procedure TfrmMain.PageControl1Change(Sender: TObject);
begin
if PageControl1.ActivePage=Tabsheet2 then
   Begin
 
   EmbeddedWB1.LoadFromStrings(SynEdit1.Lines);
   
   end;
end;

Open in new window

0
 

Accepted Solution

by:
ST3VO earned 0 total points
ID: 24314651
Fixed it! Had to use absolute path and navigate instead of loadfromstrings
0
 

Author Comment

by:ST3VO
ID: 24314680
Fixed it myself.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 78
how can i search if string exist in array ? 3 69
JAudiorecorder record freezing the app 29 82
Base1 Encode/Decode 3 85
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question