开发者

How can I change the color of each character in a textblock

I am writing a little diff tool and need to be able to change the color of a character depending on if its the same, added, removed. What would be the best way to handle this? 开发者_StackOverflow中文版 Is a textblock a good control to start with?


You can use the Run tag.

<TextBlock><Run Foreground="Red">T</Run>ex<Run Foreground="Green">t</Run></TextBlock>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜