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?
Printable View
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?
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!
yup that got me working thanks.