9 Replies - 3587 Views - Last Post: 29 May 2010 - 08:15 AM Rate Topic: -----

#1 xenor  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 148
  • Joined: 23-September 09

Textbox line number

Posted 28 May 2010 - 10:49 AM

Is there any chance of making a textbox line number like in notepad++, and how ?
Is This A Good Question/Topic? 0
  • +

Replies To: Textbox line number

#2 fixo  Icon User is offline

  • D.I.C Regular

Reputation: 85
  • View blog
  • Posts: 335
  • Joined: 10-May 09

Re: Textbox line number

Posted 28 May 2010 - 12:26 PM

View Postxenor, 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'~
Was This Post Helpful? 0
  • +
  • -

#3 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

Re: Textbox line number

Posted 28 May 2010 - 12:38 PM

fixo, I don't think this is what this user was looking for...
Was This Post Helpful? 0
  • +
  • -

#4 fixo  Icon User is offline

  • D.I.C Regular

Reputation: 85
  • View blog
  • Posts: 335
  • Joined: 10-May 09

Re: Textbox line number

Posted 28 May 2010 - 12:44 PM

View PostFlashM, on 28 May 2010 - 11:38 AM, said:

fixo, I don't think this is what this user was looking for...


Whoops, so ignore my post, sorry

~'J'~
Was This Post Helpful? 0
  • +
  • -

#5 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

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 :-)
Was This Post Helpful? 0
  • +
  • -

#6 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

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.
Was This Post Helpful? 0
  • +
  • -

#7 Searock  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 35
  • View blog
  • Posts: 259
  • Joined: 15-September 09

Re: Textbox line number

Posted 28 May 2010 - 06:58 PM

Try using ScintillaNET.

Here's a screenshot.

Posted Image

This post has been edited by Searock: 28 May 2010 - 07:01 PM

Was This Post Helpful? 0
  • +
  • -

#8 ghqwerty  Icon User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

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.
Was This Post Helpful? 0
  • +
  • -

#9 xenor  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 148
  • Joined: 23-September 09

Re: Textbox line number

Posted 29 May 2010 - 01:03 AM

View Postghqwerty, on 28 May 2010 - 11:35 PM, said:

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.


Nice question
Was This Post Helpful? 0
  • +
  • -

#10 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

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.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1