How to write line numbers of richtextbox RRS feed

  • Question



    I have 2 questions. How can i write the line numbers in richtextbox? For example front left. For example Code block in this forum.

    How can show text as program code? For example i open one .CS filter file and the program show text like program style.


    Friday, July 15, 2011 9:56 AM


  • So you want line-numbers and syntax highlighting?

    For line numbers, take a look at using this control: http://www.codeproject.com/KB/cs/Line_Numbers_for_RichText.aspx. The author allows for free commercial (he just wants a thank-you in the program) and private use.

    For syntax-highlighting, however, you need to implement that yourself. Just google "c# syntax highlighter", it's been done many times before.

    • Marked as answer by SudoSu Saturday, July 16, 2011 8:39 AM
    Friday, July 15, 2011 1:56 PM