Add a DataGridView, a PrintDocuemnt, and a Button then:
button click events {
printDocument1.Print();
}
printDocument1_PrintPage events {
Bitmap bm = new Bitmap(this.dataGridView1.Width, this.dataGridView1.Height);
this.dataGridView1.DrawToBitmap(bm, new Rectangle(0, 0, this.dataGridView1.Width, this.dataGridView1.Height));
e.Graphics.DrawImage(bm, 0, 0);
}
That's all your data printing.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…