Hi
I'm very much new to .net application,
I'm doing a project where I want to get proper alignment at print time I'm not getting it.
Actually I want my print preview like many shopping mall bill(barcode,itemname,rate,quantity)all display exactly below
of all item here in my code I'm getting difference in all those item.I'm using winfrom and access database.
Please help me.
How to get alignment Rich textbox
Plz Help me i m eagerly Waiting for it even i did lot of googling........
Thanks in Advance
private void Doc_PrintPage(object sender, PrintPageEventArgs e)
{
Font font = new Font("Verdana", 10);
Font font2 = new Font("Verdana", 40, FontStyle.Bold);
float x = e.PageSettings.HardMarginX;
float y = e.PageSettings.HardMarginY;
float x1 = (e.PageSettings.Margins.Left = 10);
float y1 = (e.PageSettings.Margins.Top = 60);
string longline = "_________________________________";
string clipinfo = "Date:" + System.DateTime.Now.ToShortDateString() + "" + "\n" + "Time : " + System.DateTime.Now.ToShortTimeString() + "" + " " + "Cashier :" + lbluserid.Text + "~" + userid1 + "";
string Billheadinginfo = "SNo. " + "Item Name" + " " + "Qty" + " " + "Rate" + " " + "Amount";
string Billvalue = "Total : ";
string Thanks = " THANK YOU VISIT AGAIN ";
float lineHeight = font.GetHeight(e.Graphics);
string name = "Quotation";
for (int i = 0; i < 1; i++)
{
e.Graphics.DrawString(name, font2, Brushes.Black, x, y);
e.Graphics.DrawString("\n" + longline + "\n" + clipinfo + "\n" + longline + "\n" + Billheadinginfo + "\n" + longline + "\n" + richTextBox2.Text + longline + "\n" + Billvalue + "\n" + longline + "\n" + "\n" + Thanks, font, Brushes.Black, x1, y1);
y += lineHeight;
}
y += lineHeight;
}