在Winform上显示HTML [英] Display HTML on a winform
问题描述
我正在开发一个win窗体应用程序,该应用程序需要一些时间来显示弹出"窗体,该窗体在Internet(HTML)上显示一部分网页. 我正在使用经典的Web请求获取页面的HTML:
I'm developing a win-form application that needs sometime to show a "pop-up" form that displays a portion of a web page on internet (HTML). I'm getting the HTML of the page using a classic web request:
var serviceRequest = new WebClient();
var response = serviceRequest.DownloadString(new Uri("www.something.com"));
我已经尝试使用网络浏览器控件,该控件确实运行良好,但是您知道使用它是基于COM对象的,因此存在多个问题.(我无法动态创建其他表单包含未创建线程STA等的Web浏览器控件)
I have already tried to use the web browser control which works really well but as you know there are several issue using it as it is based on a COM object.(I cannot dynamically create another form that contains the web browser control without create a thread STA etc)
我需要的只是容器",可以在其中注入要显示的HTML.
All I need is "container" where I can inject the HTML I want to display.
有什么建议吗?
非常感谢
推荐答案
尝试使用内置的WebBrowser控件.
Try to use built-in WebBrowser control.
在CodeProject上的引用:
References at CodeProject:
有关托管HTML渲染,请参见专业HTML渲染器
For Managed HTML Rendering, see Professional HTML Renderer
有关动态HTML呈现,请参见在WinForm应用程序中显示动态HTML
For Dynamic HTML Rendering, see Show Dynamic HTML in WinForm Applications
这篇关于在Winform上显示HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!