Basic Formatting
There are many different settings for the format of a rich textbox. The
four basic ones are: SelBold, SelItalic, SelUnderline, and SelStrikethru. These
are all booleans(True or False). Any text editing after these are changed
will be displayed the way selected, but the text already there will not bet changed.
Changing these settings:
Object.SelBold = Boolean
Object.SelItalic = Boolean
Object.SelUnderline = Boolean
Object.SelStrikethru = Boolean
RichTextBox1.SelUnderline = True
'Any text after this property is turned on will be underlined
Next you will learn how to change the font size and font name. Changing the font
size and name is very simple. You just need to know the name of the font
you want. Also the font name doesn't have to be case sensitive.
Change the font name:
Object.SelFontName = FontName
If the font name is a variable, then you don't requir quotes, else you must put
quotes around it
RichTextBox1.SelFontName = "Times New Roman"
'Or
Dim Font As String
Font = "Times New Roman"
RichTextBox1.SelFont = Font
The font size is even simpler
Object.SelFontSize = Integer
RichTextBox1.SelFontSize = 12
'The following text will be size 12
The number for a font size doesn't need to be in quotes, but a variable could
represent a number.