problem RichTextBox

  • Thread starter Thread starter halex2000
  • Start date Start date
H

halex2000

Hi, I'm new with Csharp and have an annoying problem with RichTextBox: I
cannot change the text by modifying the Rtf property from a derived class.

String sRTF = Rtf;
sRTF = sRTF.Insert(insertloc,
"{\\colortbl
;\\red128\\green0\\blue0;\\red0\\green128\\blue0;\\red0\\green0\\blue255;}");
Rtf = sRTF;

If I print the sRTF content on the console, the ouput is exactly what
expected, with the new string in the correct position.But if I print Rtf
(that should be identical) it is as if I never modified it. Is there
something I miss about CSharp?
Thank you!
 
Thank you, but Rtf is of type string, which does not contain a member 'text'
and in fact the compiler complains for this error. The documentation says
that RichTextBox.Rtf can be used for both get and set the content of the
control (not only text but also rtf tags), but I seem to be unable to modify
Rtf, doesn't matter how I try to do it :-(
 
Back
Top