Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HTML Preview

Posted on 2009-05-06
8
Medium Priority
?
467 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 200 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Industry Leaders: 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

722 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