RichTextBox Text Insertion Problem
hello guys... i have an output error everytime i try to insert text into the rich text box.. here's my code:
Code:
with Richtextbox
.seltext = "// A sample comment"
.seltext = "// another sample comment"
end with
well with regards to the output... here is the supposed output of this code..
// A sample comment
// another sample comment
well... with this code that i provided.. here is the output
// A sample comment // another sample comment...
- the text was inserted in one line.. instead the " //another sample comment" should be in the next line...
How can i put the "//another sample comment" in the next line of the RTB Control??
thanks... :)
Re: RichTextBox Text Insertion Problem
I am not sure one is what you need but....
try this
Private Sub Form_Load()
With RichTextBox1
.SelText = "A sample comment" & Chr(13) & "another sample comment"
End With
End Sub
Re: RichTextBox Text Insertion Problem
Seltext just continued where it is up too. it doesn't put in a new line. To add a new line you have to do it yourself. Like the code posted by nf_vb.
with Richtextbox
.seltext = "// A sample comment"
.SelText = vbnewline
.seltext = "// another sample comment"
end with