RichTextBox BackColor of Selected RTF

Richard Kucia <[email protected]> Mon, 12 Nov 2007 12:18:32 -0500
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <LISTSERV%[email protected]>
I need to grab some RichText from a RichTextBox and paste it at an
insertion point into a second RichTextBox. After the paste, the new text
is supposed to be black text on a yellow background.

There is no SelectionBackColor property on the RTB, so that's out.

I've tried to paste the RTF into a temporary RTB and set that RTB's
ForeColor and BackColor properties. That works -- on the temporay RTB.
When I grab that RTF and paste it into the final RTB, it acquires the
colors of the surrounding text.

I can select the inserted RTF and adjust its ForeColor, but there's no
method to set its BackColor.

A Google search has turned up a lot of suggestions that involve either a)
parsing the raw RTF, or b) SendMessage calls, or c) third-party
substitutions for the Microsoft RTB. All of these options are out-of-
bounds for my application.

Is there an alternative?

Thanks.

Rick Kucia