简体   繁体   English

如何在Windows应用中显示HTML?

[英]How do you display HTML in windows app?

I have a bunch of HTML code that I need to display in a label/textbox in a windows app written in c#. 我有一堆HTML代码,我需要在用c#编写的windows应用程序的标签/文本框中显示。 It should be in such a way that the output shows the HTML formatted text, rather than the HTML code itself. 它应该以输出显示HTML格式文本的方式,而不是HTML代码本身。

How can I do this? 我怎样才能做到这一点?

Render your HTML in WebBrowser control. WebBrowser控件中呈现HTML。 It has special events for document and you can iterate by tags like this Hope it will help you;) 它有文件的特殊事件,你可以像这样的标签迭代希望它会帮助你;)

查看WebBrowser

There's a web browser control using IE's rendering engine to display HTML content. 有一个Web浏览器控件使用IE的渲染引擎来显示HTML内容。 You might as well be able to do some simple parsing yourself and use a RTF control but that way you will be rather restricted. 你也可以自己做一些简单的解析并使用RTF控件,但这样你会受到相当的限制。

If WebBrowser doesn't suit your needs you can check out these libraries with HTML label/control support 如果WebBrowser不能满足您的需求,您可以使用HTML标签/控件支持查看这些库

只读模式下的HTML编辑器 (MSHTML的包装器,Internet Explorer的呈现部分)可能就是您所需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows应用商店应用中显示html - Display html in Windows Store app 如何在Windows 8 Metro应用程序中显示部分HTML页面 - How to display partial HTML page in Windows 8 metro app 如何在Windows 10 UWP应用程序中播放(MIDI)声音? - How do you play a (MIDI) sound in a Windows 10 UWP App? 您如何对Windows Phone 8.1应用进行Beta测试 - how do you beta a windows phone 8.1 app 您如何在 Windows 应用商店应用程序中设置 WebView 控件的样式? - How do you style WebView control in Windows Store App? 如何在Windows Forms App中播放MP4视频 - How do you playback MP4 video in a Windows Forms App 如何使用 Windows Forms 显示 Html 文件? - How do I display Html file using Windows Forms? 当无法访问Web服务URL时,如何在Windows Mobile中显示“无法连接”对话框? - How do you display the “cannot connect” dialog in windows mobile when a webservice URL is unreachable? 在.NET中,如何制作不在Windows窗体上显示的自定义控件? - In .NET, how do you make a customized control that does not display on the windows form? 如何可靠地在所有版本的Windows上读取用户的显示(第一个和最后一个)名称? - How do you read the user's display (first and last) name on all versions of Windows reliably?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM