Richtextbox: How can I indent the second line upto the end of the paragraph 
Author Message
 Richtextbox: How can I indent the second line upto the end of the paragraph

How can I indent the second line in a richtextbox upto the end of the
paragraph.

For example if this is the paragraph:

---------------------------------------------------------------------------------------------------------
John 1:12 But as many as received him, to them gave he power to become
the sons of God, even to them that believe on his name.

John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.

---------------------------------------------------------------------------------------------------------

I want this to put in a richtextbox that display this as follows:

John 1:12 But as many as received him, to them gave he power to become
        the sons of God, even to them that believe on his name.

John 3:16 For God so loved the world, that he gave his only begotten
        Son, that whosoever believeth in him should not perish, but
        have everlasting life.



Sat, 14 Feb 2004 08:34:10 GMT  
 Richtextbox: How can I indent the second line upto the end of the paragraph
Your example doesn't make it very clear, since both sets of paragraphs look
exactly the same, but if you mean what I think you mean then you should have
a look at the SelHangingIndent property of the Rich Text Box. For example:

RichTextBox1.SelHangingIndent = 100
RichTextBox1.LoadFile "c:\windows\desktop\mystuff.txt"

This will set the "hanging indent" for all paragraphs in the RichTextBox,
but you can set each paragraph independently (to different settings, if you
wish) by positioning the cursor somewhere inside a paragraph and then using
the SelHangingIndent (or some other similar) property to set the style for
that particular paragraph.

By the way, the values (100 in the above example) are in whatever units have
been set for the container of the RichTextBox (usually your Form). This
defaults to Twips, and so the above code sets the{*filter*} indent to 100
Twips. If, however, you set the Form's ScaleMode to some other setting
(vbPixels, for example) then you should use those values instead.

Mike


Quote:
> How can I indent the second line in a richtextbox upto the end of the
> paragraph.

> For example if this is the paragraph:

> --------------------------------------------------------------------------

-------------------------------
Quote:
> John 1:12 But as many as received him, to them gave he power to become
> the sons of God, even to them that believe on his name.

> John 3:16 For God so loved the world, that he gave his only begotten
> Son, that whosoever believeth in him should not perish, but have
> everlasting life.

> --------------------------------------------------------------------------

-------------------------------
Quote:

> I want this to put in a richtextbox that display this as follows:

> John 1:12 But as many as received him, to them gave he power to become
> the sons of God, even to them that believe on his name.

> John 3:16 For God so loved the world, that he gave his only begotten
> Son, that whosoever believeth in him should not perish, but
> have everlasting life.



Sat, 14 Feb 2004 09:21:01 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. End-of-Line vs. End-of-Paragraph

2. Paragraph first line indent

3. resetting default first line indent, hanging indent

4. Indenting Paragraphs in Text Formatted Email

5. line graph in vb (canned routine)

6. Finding multi-line paragraphs (wrapped lines)

7. Indenting Text With RichTextBox

8. RichTextBox indenting???

9. Indent Richtextbox control

10. Indent Richtextbox control

11. Indent Richtextbox Control

12. Indent of a RichTextBox control

 

 
Powered by phpBB® Forum Software