First there's coloring. You set this by changing the SelColor to the color
of your choice. You can use any color (vbcolor, RGB, QBColors).
Object.SelColor = color
RichTextBox1.SelColor = vbGreen
'Now anything typed will be green
Now protecting. Protecting disabled editing from the selected text
Object.SelProtected
RichTextBox1.SelProtected = True
Any text that was selected during this method is now protected.
Bullets are creating by setting the SelBullet property to true. This creates
bullets where new lines are put, and the line the cursor was just at.
Object.SelBullets = True
'RichTextBox displays:
'We are know for:
'Creating programs
RichTextBox.SelBullets = True
'RichTexBox now displays
'We are know for:
'·Creating programs
With the bullets you can indent them using BulletIndent
Object.BulletIndent = Integer
'Using the one before
'RichTextBox1 displays:
'We are know for:
'·Creating programs
RichTextBox1.BulletIndent = 200
'RichTextBox1 no displays:
'We are know for:
'· Creating programs
Next is how to superscript or subscript. To make superscript or subscript you
have to use the SelCharOffSet and SelFontSize at the same time. The SelCharOffSet
just changes the position of the text.
Using the SelCharOffSet property:
Object.SelCharOffSet property
To subscript, you just need to change the SelFontSize. If
you want to superscript, you must change the font size and the SelCharOffSet.
Hello
SubScript:
Dim VariableName As Integer
Integer = Object.SelFontSize
Object.SelFontSize = Integer / 3 * 2
'This makes the size 2/3 of the original
SuperScript:
Dim VariableName As Integer
Object.SelFontSize = Integer / 3 * 2
Object.SelCharOffSet = Temp * 5
That is how you can make a subscript or superscript font. They covers most
of the control on the rich textbox.
Comments