Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background color #7

Open
sgolivernet opened this issue Sep 22, 2012 · 1 comment
Open

Background color #7

sgolivernet opened this issue Sep 22, 2012 · 1 comment

Comments

@sgolivernet
Copy link
Owner

Am I wrong or background color is missed?
I'm serarching just for this feature. I've tried making this for myself but I could'nt show text whith other background color than main in RichTextControl.
It's, at last, curious you missed just this.
Can someone help me?

@Vahalas
Copy link

Vahalas commented Feb 14, 2017

I needed the ability to highlight certain blocks of text so I went ahead and added highlight support based on version 0.4.0.
RtfDocument.zip

I first tried adding support for setting a background color but that didn't seem to work when the file was rendered in Microsoft Word. The challenge with highlighting is that there's no end tag so any text that's added with a highlight must be wrapped in a group. The code I wrote automatically adds that group. While highlighting in the Rtf spec technically allows different colors to be used I only implemented a stock yellow highlight.

The following file was modified:
RtfDocument.cs
The following methods were modified to add a new default parameter:
public void AddText(string text, RtfCharFormat format)
public void AddText(string text)
private void InsertText(string text)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants