更改Ritchbox中的颜色 [英] change the color in ritchbox

查看:63
本文介绍了更改Ritchbox中的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我试图通过从Windows窗体Colordialog获取颜色值来更改wpf排列框中的文本颜色.

Hi, i tried to change the color of text in a wpf ritch box, by getting the color value from a windows forms Colordialog 

这是背后的代码:

 WpfFontColordialog wpfcolor = new WpfFontColordialog();
            Color cl = wpfcolor.opendialog();// wpfcolor:class
            MessageBox.Show("" + cl);
            TextRange tr = new TextRange(richTextB.Document.ContentStart, richTextB.Document.ContentEnd);
            tr.ApplyPropertyValue(TextElement.ForegroundProperty,cl);

却没用

but it didn't work

推荐答案

1.  不是起作用了,而是它做了什么?

1.   Rather than it did not work, what did it do?

2.  什么是WpfFontColordialog,它返回什么?

2.   What is WpfFontColordialog and what does it return?

3.  什么是使用"?语句在您的代码背后?

3.   What "using" statments are in your codebehind?

LS


这篇关于更改Ritchbox中的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆