Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to put line numbers in Textbox with multiline

How to put line numbers in Textbox with multiline

Scheduled Pinned Locked Moved ASP.NET
tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vinay_sinha
    wrote on last edited by
    #1

    I have a textbox with multiline where one can write source code and compile & run it,my requirement is to implement line number like(1,2,3...) in each new line of textbox like program editor.....Thanks & Appreciates for your reply.

    L S 2 Replies Last reply
    0
    • V vinay_sinha

      I have a textbox with multiline where one can write source code and compile & run it,my requirement is to implement line number like(1,2,3...) in each new line of textbox like program editor.....Thanks & Appreciates for your reply.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      A simple hack is to put a listbox to the left of the textbox and display line numbers as items in the list box. Then you change the borders of the list box and the text box to make them appear as a single control. For more advanced uses, you need to create your own custom control like ICSharpCode.TextEditor[^] or AvalonEdit[^]

      1 Reply Last reply
      0
      • V vinay_sinha

        I have a textbox with multiline where one can write source code and compile & run it,my requirement is to implement line number like(1,2,3...) in each new line of textbox like program editor.....Thanks & Appreciates for your reply.

        S Offline
        S Offline
        Sandeep Mewara
        wrote on last edited by
        #3

        There is no direct way or a control that does what you seek. You have to develop your own control for such behavior.

        Sandeep Mewara Microsoft ASP.NET MVP [My latest Article]: Server side Delimiters in ASP.NET[^]

        V 1 Reply Last reply
        0
        • S Sandeep Mewara

          There is no direct way or a control that does what you seek. You have to develop your own control for such behavior.

          Sandeep Mewara Microsoft ASP.NET MVP [My latest Article]: Server side Delimiters in ASP.NET[^]

          V Offline
          V Offline
          vinay_sinha
          wrote on last edited by
          #4

          Thanks For ur reply :) I have got the solution by using jquery plugin... The below is the link for whole solution: http://alan.blog-city.com/jquerylinedtextarea.htm

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups