Share via


How to add line Numbers to the richtextbox margin?

Question

Sunday, October 3, 2010 10:43 PM

How to Add numbers in the margin for Line numbers Picture Provied As a example

Here

All replies (3)

Monday, October 4, 2010 12:32 AM âś…Answered

There many ways to do this, another richtextbox or label for numbers. If you want to build the solid one, just create richtextbox usercontrol that will have number line feature. Below are some articles and code that can get you started.

 http://www.codeproject.com/KB/cs/Line_Numbers_for_RichText.aspx
http://www.codeproject.com/KB/edit/numberedtextbox.aspx
 http://www.codeproject.com/KB/cpp/linenumbers_for_rtb.aspx
 http://convert.codes-sources.com/file2cs.aspx?ID=45415&f=Notepad+.NET/Classes/LineNumbers_For_RichTextBox.vb

some of the articles code are written for C# but you can convert it to VB.NET in any of the links below

kaymaf

CODE CONVERTER SITE

http://www.carlosag.net/Tools/CodeTranslator/.

http://www.developerfusion.com/tools/convert/csharp-to-vb/.


Sunday, October 3, 2010 10:55 PM

Menu: Tools -> Options

 

Then select "Text Editor", "All Languages", the check the box for "Display", "Line Numbers".

--
Mike


Monday, October 4, 2010 12:35 AM

Sorry, I missed the subject line saying RichTextBox...

--
Mike