开发者

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

开发者 https://www.devze.com 2023-04-06 11:03 出处:网络
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 c

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开发者_JAVA百科 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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消