最佳控制渲染HTMLHTML

2023-09-06 21:57:47 作者:亡鱼是深海的疤

我有必要将一些HTML文本(不与℃的html页面; HTML> <身体GT; 标签,一切,只是一些< I> <小时/> 和东东)在C#.net 4.0 WinForms应用程序。 preferably这将是一个面板式的控制,你可以只 p.HTML =somehtml上它会显示HTML。有没有人有.NET HTML的经验呈现的控制,他们可以推荐?我发现这在$ C $的CProject,但我在那里有点担心的东西。

I have the need to render some html text (not an html page with <html> and <body> tags and everything, just some <i>'s and <hr />s and stuff) in a C# .NET 4.0 Winforms application. Preferably it would be a Panel-like control that you could just p.HTML = "somehtml" on and it would display HTML. Has anyone had any experience with .NET HTML rendering controls that they could recommend? I found this on codeproject but I'm a little wary of stuff on there.

推荐答案

为什么不使用内置的 web浏览器控制。您可以随时在封闭的HTML代码段标准&LT; HTML /&GT; 标记

Why not use the build in WebBrowser control. You can always enclose your html snippet in standard <html/> markup.

string html = "<i> some text </i>";
webbrowser1.DocumentText = string.Format("<html>{0}</html>", html);
 
精彩推荐
图片推荐