Is there any chance of making a textbox line number like in notepad++, and how ?
Textbox line number
Page 1 of 19 Replies - 4838 Views - Last Post: 29 May 2010 - 08:15 AM
Replies To: Textbox line number
#2
Re: Textbox line number
Posted 28 May 2010 - 12:26 PM
xenor, on 28 May 2010 - 09:49 AM, said:
Is there any chance of making a textbox line number like in notepad++, and how ?
You can try something like this
string nl = Environment.NewLine; this.textBox1.Multiline = true; this.textBox1.AppendText("1. alpha" + nl); this.textBox1.AppendText("2. bravo" + nl); this.textBox1.AppendText("3. charlie" + nl); this.textBox1.AppendText("4. delta" + nl);
~'J'~
#3
Re: Textbox line number
Posted 28 May 2010 - 12:38 PM
fixo, I don't think this is what this user was looking for...
#4
Re: Textbox line number
Posted 28 May 2010 - 12:44 PM
#5
Re: Textbox line number
Posted 28 May 2010 - 12:53 PM
One nasty hack would be to have two multi-line textboxes next to each other, touching with their inner edges. The for every new line in the right textbox, you'd increase a counter and write this value in a new line inside left text box... But there should be a better solution to this :-)
#6
Re: Textbox line number
Posted 28 May 2010 - 01:44 PM
Just spitballin here but couldn't you have a thin ListBox for the numbers and style it up? It would work.
#7
Re: Textbox line number
Posted 28 May 2010 - 06:58 PM
Try using ScintillaNET.
Here's a screenshot.
Here's a screenshot.

This post has been edited by Searock: 28 May 2010 - 07:01 PM
#8
Re: Textbox line number
Posted 29 May 2010 - 12:35 AM
how do you use scintilla ? is it some kind of library or another program all together ? is its a library how do you set it up so that it can be used in a program. Currently i have downloaded it and it is a zipped folder on my harddrive.
#9
Re: Textbox line number
Posted 29 May 2010 - 01:03 AM
#10
Re: Textbox line number
Posted 29 May 2010 - 08:15 AM
You remember the first page you landed on when you followed his link? Up at the top there was a big button that reads "Documentation". Click on it, and amazingly you get to the section where it explains how to install and use the software.
Page 1 of 1