hello, how can i append the text in rich text box say i need to append in line 40 and column 30
A:
Take your string, count the lines, then use string manipulation to manually insert your string in the correct position.
You could count lines by counting occurrences of '\n' and for column you just add column number to the position that you find your line at.
If this is too little info, ask me and I can paste you a c# code for it.
Daniel Mošmondor
2010-10-03 10:50:38
A:
For your specific example you'd use code like this:
Dim pos As Integer = RichTextBox1.GetFirstCharIndexFromLine(40)
RichTextBox1.SelectionStart = pos + 30
RichTextBox1.SelectionLength = 0
RichTextBox1.SelectedText = "foo"
If you need to preserve the selection then save the SelectionStart and SelectionLength properties first and restore them afterwards.
Hans Passant
2010-10-03 13:07:16