|
-
Mar 28th, 2007, 09:09 AM
#1
Thread Starter
New Member
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...
-
Mar 28th, 2007, 09:47 AM
#2
Member
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
-
Mar 28th, 2007, 10:29 AM
#3
Frenzied Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|