i want to insert text in textbox at specific location(i.e row 2 column 3).how can i do that ?

i tried this but its not working

`Me.RichTextBox1.Text = Me.RichTextBox1.Text.Insert(i, CChar(cb.Text))`

2
Contributors
1
Reply
16
Views
3 Years
Discussion Span
Last Post by Reverend Jim

You can replace text by setting the properties SelectionStart and SelectionLength then replacinig the selected text by assigning the replacement string to SelectedText. If you set SelectionLength to 0 then the text is inserted at the given point. For example, to insert a string at position 20, do

``````RichTextBox1.SelectionStart = 20
RichTextBox1.SelectionLength = 0
RichTextBox1.SelectedText = "inserted string"
``````
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.