Set font of the first line in a Richtextbox RRS feed

  • Question

  • Hai

    I am using a  RichTextbox in my c# windows application.I want to give red colour only for first line in the RichTextbox.

    For that i try:

                    txtRich.SelectionStart = 0;
                    txtRich.SelectionLength = 10;
                    txtRich.SelectionFont = new System.Drawing.Font("Tahoma", 10, FontStyle.Bold);

    The problem is, all the text in the textbox is showing in font size 10.I want this condition to applay for only a single line.

    Please help me

    Thursday, December 5, 2013 11:09 AM