You want to use
You want to use the DrawString overload that takes a
System.Drawing.StringFormat, and you want to set the StringFormat's
alignment property to Far
Do something like this (Replace the font, brush, text, and rectangle with
your own):
System.Drawing.StringFormat Text3Format = new
System.Drawing.StringFormat(System.Drawing.StringF ormat.GenericTypographic);
Text3Format.Alignment = System.Drawing.StringAlignment.Far;
e.Graphics.DrawString(this.Text3, this.Text3Font, this.Text3Brush,
this.Text3Rect, Text3Format);
--
Justin Weinberg
Designing a PrintDocument? Drawing to forms?
Check out GDI+ Architect at
www.mrgsoft.com
"[Yosi]" <yo*****@taux01.nsc.com> wrote in message
news:06****************************@phx.gbl...
I trying to print my App form by printDocument,
i trying to draw the text box, but i don't know how to
draw the the text in the right alignment.
// print edit box control contents
if (Controls[i].GetType() == this.textBox1.GetType())
{
TextBox theText = (TextBox)Controls[i];
g.DrawString(theText.Text, theText.Font, Brushes.Black,
theText.Bounds.Left*scalex, theText.Bounds.Top * scaley,
new StringFormat());
}
the result of this is. the text print in left align how
to to make it to be on the right align