Add Colored Text To RichTextBox

Article 55 in C-Sharp

2020-09-24 07:38:02 from bugfish
Add Colored Text To RichTextBox
C-Sharp / Hints
Last Review on: 2021-10-27 04:09:23 | Hits: 291

You can add this function to display colored text in a richtextbox! [Just Append With that Function]

        private void AddTextToRTB(RichTextBox rtb, string txt, Color col)
            int pos = rtb.TextLength;
            rtb.Select(pos, txt.Length);
            rtb.SelectionColor = col;

I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
Currently 0 Upvotes!
captcha image
System - 2021-01-01 19:30:45
We appreciate comments on our site!

This Website is using Session Cookies for Site Functionality and AWStats.