RTF - Codes
-
Hi I tryed to use the RTF codes in RtfBox, doesnt work :( How can i bold a text in a RTFBox without the "SELECT Method"(Select the text, and the Selection Font and Color ) ? only \b doesnt work, appers a square :( Thanks.
First off, you're getting the square because you're trying to set RTF codes using the
Text
property, which has no knowledge of RTF codes. (And you're not using the @ symbol in front of your string, so C# thinks "\b" is an escape character. Either make it a string literal or escape the backslash "\\b".) If you want direct access to the RTF codes in aRichTextBox
, you should use theRtf
orSelectedRtf
properties. However, I don't think that's what you're looking for, as it will make it quite a bit more difficult than usingSelectionFont
,SelectionColor
, etc. TheRtf
andSelectedRtf
properties will give you the entire Rtf formatting string for the contents of the control or selection, respectively. There are intended more for pasting RTF from other sources. You can't use them to simply turn bold or color on or off. Charlie if(!curlies){ return; }