Tommy B.
Tommy B.

Reputation: 3639

c#/.NET/Winforms RichTextBox : Highlight active line

I'm making a very simple text editor and I'd like to color the background of the whole selected line (left to right). And I'd like it to follow the cursor so if I go down two lines the background changes.

I'm looked a lot on here and google and found nothing interesting, it always colors the text instead of the background and it does not color the entire line, etc.

Any suggestions are welcome!

Thanks!

Upvotes: 2

Views: 990

Answers (1)

Davide Piras
Davide Piras

Reputation: 44595

I am not sure you can easily color the full line where the caret is in the standard RichTextBox control, I think I mostly heard only the background of already entered text could be colored.

If you are not forced to stay with the standard RichText you can have a look at this:

ScintillaNET

this editor has an incredible amount of features, the only thing is that I am not sure if it supports many different fonts otr picture embedding, tables and so on.

if ScintillaNET is nout enough either I would then try with DevExpress components for Windows Forms, extremely feature rich and powerful, in theri demo they have basically made a text editor with tables, mailmerge and so many other things it looks almost like MS Word.

Upvotes: 3

Related Questions