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.
Rich Text Box Controls
- Introduction
- Basic Formatting
- Inserting text
- Indents & Aligning
- Colors, bullets & superscript
Basic Formatting
You might also like...
About the author
ZERO-COOL
I'm a 12 year old child who is interested in learning programming languages. My current two are Visual Basic and C++.
Interested in writing for us? Find out more.
VB 6 books
-
Programming with Microsoft Visual Basic 2008
Programming with Microsoft Visual Basic 2008, Fourth Edition by the best-selling author, Diane Zak, is designed for a first course in programming. Using the most recent version of the software, Visual Basic 2008, this book teaches individuals how to ...
VB 6 forum discussion
-
CorelDRAW VBA: cdrTraceLineDrawing FAILS, producing single linear path instead of Centerline trace?
by dancemanj (0 replies)
-
client/server application using activex
by beautifulheart (0 replies)
-
System Error &H8007007E. The specifed module could not be found.
by swiftsafe (5 replies)
-
Invitation to take part in an academic research study
by researchlab (0 replies)
-
Send SMS with SMPP
by mmahmoud (0 replies)
VB 6 podcasts
-
Stack Overflow Podcast: Podcast #45 – Keeping it Sharp
Published 7 years ago, running time 0h54m
Our guest this week is Eric Lippert – language architect extraordinaire and famous for all his work at Microsoft in developing their languages Eric joined Microsoft right out of college and was originally working on VB It’s time for everyone’s favorite game: Name the Worst Feature of that Microso.
Comments