
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.