在WPF C#中更改文本某些部分的颜色

时间:2016-04-14 08:54:23

标签: c# wpf xaml

我的问题与:Change color and font for some part of text in WPF C#

有关

有一个答案表明您可以使用以下语句更改文本前景色:

rangeOfText1.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Blue);

但是,这对我不起作用:我收到运行时错误,指示参数类型SolidBrush不能用于ForegroundProperty。怎么了?

1 个答案:

答案 0 :(得分:3)