14

无论如何在WPF中将HTML从字符串变量显示到TextBlock?

4

3 回答 3

3

也许你可以使用这个WPF Html 支持的 TextBlock

于 2011-03-01T22:20:02.803 回答
1

Can't do it in TextBlock, you need a WebBrowser control (or Frame, but it is obsolete). Feed descriptions, btw, can contain JavaScript - would be pretty hard for TextBlock to handle ;)

于 2009-07-02T06:24:27.510 回答
0

字符串 html = " <div>hi</div> <div>&nbsp;</div> <p>this is the new line&nbsp;<br /><br />second line</p> <p>third line</p>";

TextBlock.Text = Windows.Data.Html.HtmlUtilities.ConvertToText(html);

于 2016-03-09T10:07:36.073 回答