Write memory data to the TWebBrowoser control - only IE6 and above

xiaoxiao2021-03-06  17

Add a TWEBBROWOSER control, then use the following code to write the page data to the TWEBBROWOSER control to display:

Procedure TFORM3.BUTTON1CLICK (Sender: TOBJECT); VARDOC: Olevariant; Begin WebBrowser1.naviGate ('About: blank'); WebBBrowser1.oleObject.Document.close;

Doc: = webbrowser1.document; doc.write (HTML text); // "HTML text" = HTML language text required to display, string format WebBrowser1.Refresh;

END;

This method has a disadvantage that IE5 and below are not supported. If you have a better solution, please give a point.

转载请注明原文地址:https://www.9cbs.com/read-42194.html

New Post(0)