برنامه نویسی

void printDocument1_PrintPage(object sender, PrintPageEventArgs e)

{

Image newImage = Image.FromFile("sorathesab.jpg");

int x = 12;

int y = 30;

e.Graphics.DrawImage(newImage, x, y, 550, 750);

Font drawFont = new Font("B Nazanin", 11, FontStyle.Bold);

SolidBrush drawBrush = new SolidBrush(Color.Blue);

StringFormat drawFormat = new StringFormat();

drawFormat.Alignment = StringAlignment.Center;

//

//

//

DataGridViewCell cel = new DataGridViewButtonCell();

DataGridViewRow GridRow = new DataGridViewRow();

int i = 200;

GridRow = dataGridView1.Rows[1];

cel = GridRow.Cells[0];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[1];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[2];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[3];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[4];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[5];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[6];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[7];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[8];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[9];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[10];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

cel = GridRow.Cells[11];

e.Graphics.DrawString(cel.Value.ToString(), drawFont, drawBrush, 245, i); i += 10;

//

//

//

}

+ نوشته شده در  جمعه شانزدهم مهر ۱۳۸۹ساعت 12:33  توسط ابراری |