最佳控制渲染HTML [英] Best control for rendering HTML

查看:118
本文介绍了最佳控制渲染HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有必要将一些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);

这篇关于最佳控制渲染HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆