I am creating a text editor in windows form app c# .net framework. So, I want to display line numbers of Rich text box on left side. Is there a built-in control or function to do this?
I am creating a text editor in windows form app c# .net framework. So, I want to display line numbers of Rich text box on left side. Is there a built-in control or function to do this?
Unfortunately, no.
That would be a feature too specialized for a control that's capable of displaying text in loads of fancy ways.
In your case (with fixed line heights, I presume) you'd be required to add a second control aside the RichTextBox control to display the line numbers and keep its content in sync with the text displayed in the RichTextBox control.
Have you read this thread?
How to show number of a line in a RichTextBox C#
https://stackoverflow.com/questions/2567263/how-to-show-number-of-a-line-in-a-richtextbox-c-sharp
Wayne
11 people are following this question.