Printing - Right Justified

L

Luke Vogel

Hi All ...

I'm trying to print some text (for an automated letter) right justified
using the printdocument classes.

I know how to determine the left and right margins, but how do I set the
starting point for a string of text so that it finishes printing at the
right most margin?
 
H

Herfried K. Wagner [MVP]

Luke Vogel said:
I'm trying to print some text (for an automated letter) right justified
using the printdocument classes.

I know how to determine the left and right margins, but how do I set the
starting point for a string of text so that it finishes printing at the
right most margin?

\\\
Dim sf As New StringFormat()
sf.Alignment = StringAlignment.Far
e.Graphics.DrawString( _
"Hello World" & ControlChars.NewLine & "Bla", _
Me.Font, _
SystemBrushes.ControlText, _
New RectangleF(10, 10, 100, 100), _
sf _
)
sf.Dispose()
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top