Advanced Formatting
Apart from making text bold, underlined, italic or strikethrough
you can also use bullets, tab stops and left and right indents. Of these, tab
stops are the most complicated and will be covered in another section. Note:
For any of these examples, set the Scale Mode property on the Form that the
text box is contained to Millimetres, or adjust the values shown in any examples
on this page.
|
Statement
|
Action
|
| RichTextBox1.SelBullet = True |
Makes the selected text bulleted |
| RichTextBox1.BulletIndent = 10 |
Sets the distance between the bullet and the text to 10 (applies
to all) |
| RichTextBox1.RightMargin = 100 |
Sets the right margin of all the text in the Rich Text Box
to 100. |
| RichTextBox1.SelRightIndent = 100 |
Sets the right indent of all the selected text in the Rich
Text Box to 100 (measured from the left). |
| RichTextBox1.SelIndent = 100 |
Sets the selected text left indent to 100 |
So, the following code will set make the selected text bulleted, indents by
10 mm and sets the right margin to 100 mm
' Set the forms scale mode
Me.ScaleMode = vbMillimeters
' Set the bullet
RichTextBox1.SelBullet = True
' Set the indent
RichTextBox1.SelIndent = 10
' Set the right margin
RichTextBox1.RightMargin = 100
-
Posted by mmarksbury on 24 Apr 2008
This is long past the topic post date but...
I used the selection method (where you select text and then update it), for formatting the output of an application's process in a RTF. ...
-
Posted by magiel on 06 Jan 2007
I am had the same proplems;
RichTextBox1.SelectionFont.Bold
RichTextBox1.SelectionFont.Underline etc are readonly
Solved them the following way
... -
Posted by Verdi on 21 Sep 2006
Kylua, your efforts were not wasted...
You have probably saved me a week's worth of head-pounding. Why it is so difficult to programmatically modify RTF using this control is beyond me. All...
-
Posted by Kylua on 31 Jul 2006
I spent AGES working thru this one and couldn't find it anywhere!
The basic problem is that you have to update the richtextbox.rtf, not .text.
And it is very fussy about goes in the...
-
Posted by vb_lover on 06 Dec 2005
James Crowley:
I am using vb6sp6(EM_SETTEXTMODE didn't work with vb6sp4 either) RTB control, I have already implemented URL detection similar to yours. However now i am trying to get MULTI-LEVEL U...