Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Using several TWebBrowser's to display html formated text: good practice or not?

I'm considering asking a programmer to create a delphi component based on internet explorer's TWebBrowser to easily display text by passing the html code directly to the component.

Will it consume a lot of resources or memory to display if I use a few of these components (say 6) on a single form to display basic html code?

The OS's will be Windows 2000, XP, 2003 and Vista.

Thanks!

Steven
0
smartins
Asked:
smartins
  • 3
1 Solution
 
wildzeroCommented:
How do you mean?

Like get the TWebbrowser togo a website, grab the HTML then strip the HTML and just return the text?
If so, that is very easily done.
0
 
wildzeroCommented:
Infact, I would rather use something like Indy to grab the website HTML as you can trab errors better and also wont have to wait for images to load.... but thats if we are on the same road here ;-)
0
 
smartinsAuthor Commented:
No, use TWebbrowser to display html text locally. Can be from a simple text with bold, links and other formating to a more complex page with images and tables.

But nothing to grab from the internet, all html code would be already included or generated by the application. The TWebbrowser would serve to display it.
0
 
wildzeroCommented:
ah ok, so something like

var
  sl : TStringlist;
begin
  sl := TStringlist.create;
  sl.add('<html>');
  sl.add('<head>');
  sl.add('<title>hi</title>');
  sl.add('</head>');
  sl.add('<body>');
  sl.add('Text');
  sl.add('</body>');
  sl.add('</html>');
  sl.savetofile('C:\file.html');

  webbrowser1.navigate('c:\file.html');
  sl.free;
end;

would do it.
and sure u could have 6 doing that.
I use 1 or 2 often.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now