在Windows窗体上显示HTML内容的最佳方式是什么? [英] What is the best way to display HTML content on a Windows Form?
问题描述
我可以先创建一个HTML文档,然后将其加载到Web中。
我想在我的应用程序中显示HTML格式的内容,最好在Web浏览器控件中显示。浏览器控件,但这太笨拙。
有什么方法可以将包含HTML代码的字符串直接加载到Web浏览器中?
String =< b> Hello< / b> World
预期输出: Hello 世界
我使用Visual Basic 9(VS2008) / p>
您可以通过拖动 WebBrowser
然后添加以下代码:
webBrowser1.DocumentText =< b> Hello< / b> World;
I want to display an HTML formatted content in my application preferably inside a Web Browser control.
I could create an HTML document first and then load it in the Web Browser control, but that is just too clumsy.
Is there any way I can load a string that contains HTML code directly into the Web Browser?
String = "<b>Hello</b> World"
Expected output: Hello World
I'm using Visual Basic 9 (VS2008).
You can do this by dragging a WebBrowser
control onto your application and then adding the following code:
webBrowser1.DocumentText = "<b>Hello</b> World";
这篇关于在Windows窗体上显示HTML内容的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!