|
-
Sep 30th, 2006, 09:22 PM
#1
Thread Starter
Addicted Member
RTF Formatting
Hi Guys & Gals.
I have yet another problem which I hope you will save me from.
if I had text to an rtf box using rtf code it works fine, but when I then add some more text it keeps the formatting of the previous text and not the format it should have.
At the moment I am using the .textRtf property, is there something else I should be doing.
Please help.
-
Sep 30th, 2006, 10:16 PM
#2
Re: RTF Formatting
You should use TextRTF only if you want to manipulate the document directly using RTF formatting code. You'll need to learn RTF syntax for this.
The Sel* properties are much easier to use. (but slower).
To append new text with different format, use this:
(typing freehand...)
VB Code:
RTB.SelStart = Len(RTB.Text) 'move the insertion point at end
' apply formats -->
RTB.SelBold = True
RTB.SelColor = [i]NewColor[/i]
RTB.SelItalic = True
'
RTB.SelText = "This is new text"
On a sidenote,
Unlike TextBox,TextRTF is the default property of RTB.
As a rule of thumb, if you want to work with text WITHOUT formatting, use the Text property.
or, if you want to work with text WITH formatting, use the Sel* properties.
Here is a good RTB tutorial that helped me at the beginning. I hope it will help you.
Also see Moeur's "RichTextBox Tips And Tricks" thread in the Codebank.
-
Oct 1st, 2006, 03:29 PM
#3
Thread Starter
Addicted Member
Re: RTF Formatting
This isn't what I needed, thanks for your help anyway.
I have managed to sort out my problem now
-
Oct 1st, 2006, 03:32 PM
#4
Re: RTF Formatting
 Originally Posted by DanDanDan1
This isn't what I needed, thanks for your help anyway.
I have managed to sort out my problem now 
If so then mark this thread resolved!
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
|