Please help me... i m not getting proper alignment for my text in c#.net... I'm posting snap of output along with its c#.net code... please correct me... thanks in advance
String drawString = "" + frmProperties.steel_maker;
// Create font and brush.
Font drawFont = new Font("Merchant Copy", 12F);
SolidBrush drawBrush = new SolidBrush(Color.Black);
// Create rectangle for drawing.
float x = 239;
float y = 490f;
float width = 110f;
float height = 60f;
RectangleF drawRect = new RectangleF(x, y, width, height);
// Draw rectangle to screen.
Pen blackPen = new Pen(Brushes.White);
// e.Graphics.DrawRectangle(blackPen, x, y, width, height);
e.Graphics.DrawRectangle(blackPen, x, y, width, height);
// Set format of string.
StringFormat drawFormat = new StringFormat();
drawFormat.Alignment = StringAlignment.Far;
drawFormat.LineAlignment = StringAlignment.Center;
e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect, drawFormat);
Output m getting as:
Jindal Steel &
Power Ltd.,
Chattisgarh,Well
known Steel-Maker
But Expected Output Should be some like:
Jindal Steel &
Power Ltd.,
Chattisgarh,Well
known Steel-Maker
Please Help