^

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-05-07 03:48:14 | Hits: 171

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.AppendText(txt);
            rtb.Select(pos, txt.Length);
            rtb.SelectionColor = col;
            rtb.Select();
            rtb.DeselectAll();
        }

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.
Comment Section
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.
Radio