Rich Text Box Controls

Indents & Aligning

There are 3 different indents: SelHangingIndent, Indent, RightIndent.  The SelHangingIndent is how much of an indent there is on the lines after the first. Indent is how much space there is before the first line of a paragraph.  RightIndent is the indent of the right side.  These are all adjested with a number that using the same scale at the width, heighth, top, and left (not pixels.

Object.SelHangingIndent = Number
Object.SelIndent = Number
Object.SelRightIndent = Number

'RichTextBox1 displays:
'Hi,
'Bye
RichTextBox1.SelHangingIndent = 100
RichTextBox1.SelIndent = 200
'RichTextBox1 now displays:
'      Hi,
'   Bye

The right indent just stops the text from the right side, but I didn't want to get too complicated.  Setting the alignment for a single line is just like setting the alignment for a whole textbox.

Object.SelAlignment = Number

The alignment numbers are the same for a regular textbox: 0 - Left Alignment, 1 - Right Alignment, 2 - Center Alignment.

'RichTextBox1 display:
'Hello
RichTextBox1.SelAlignment = 2
'RichTextBox1 now display:
'                 Hello

You might also like...

Comments

About the author

ZERO-COOL United States

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.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Better train people and risk they leave – than do nothing and risk they stay.” - Anonymous