How to display HTML formatted content in to label using C# WinForm?

时间:2016-09-01 06:11:22

标签: c# .net

I am using C# WinForms.

I want to display HTML formatted content in a Label control. Is it possible to do this? How can I do this?

2 个答案:

答案 0 :(得分:0)

A label is not meant to display formatted text. You can apply only one format to a label, which will be applied to the whole string.

If you want to display HTML-formatted text in a Windows Forms form, you'd better use a WebBrowser control instead of a label.

Source : http://www.codeproject.com/Answers/1121356/Display-HTML-formatted-string-in-to-label

答案 1 :(得分:-2)

You can do this but with correct approach

either use

<asp:PlaceHolder runat="server">

or can

try

<asp:Literals>