Results 1 to 3 of 3

Thread: richtextbox line insert

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2007
    Location
    indiana
    Posts
    341

    richtextbox line insert

    I need to insert a line into a richtextbox and it has to be on line 3 and it needs to move everything down one line. How would i go about doing this?

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: richtextbox line insert

    Find the character position of the first character of the third line. Set the SelectionStart property to that position. Set the SelectionLength to 0. Set the SelectedText property to "your line" & Environment.NewLine.

    There is a function available in the RTB to find the first character position of a given line, look for it!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2007
    Location
    indiana
    Posts
    341

    Re: richtextbox line insert

    yup that got me working thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width