problem RichTextBox

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!
 
H

halex2000

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 :-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top