i using c# wpf , have richtextbox , want color text in red, in green , in black. how so?
use flowdocumentreader in richtextbox. thus, can use document classes: list, paragraph, section, table, linebreak, figure, floater , span, , change properties:
<flowdocumentreader x:name="mydocumentreader" height="269.4"> <flowdocument> <section foreground = "yellow" background = "black"> <paragraph fontsize = "20"> here fun facts wpf documents api! </paragraph> </section> <list x:name="listoffunfacts"/> <paragraph x:name="parabodytext"/> </flowdocument> </flowdocumentreader>
you can fill , change properties of, here example, list right in code:
this.listoffunfacts.foreground = brushes.brown; this.listoffunfacts.fontsize = 14; this.listoffunfacts.markerstyle = textmarkerstyle.circle; this.listoffunfacts.listitems.add(new listitem( new paragraph(new run("sample text"))));
Comments
Post a Comment