我写了一个电影管理系统 要实现电影票打印功能 可是我用的printDialog1和printDocument1控件 代码如下
private void printDocument1_EndPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
MessageBox.Show("打印结束了");
}
Bitmap bit;
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(bit, 0, 0);
} private void 打印ToolStripMenuItem_Click(object sender, EventArgs e)
{
Graphics x = this.CreateGraphics();
Size s = this.Size;
bit = new Bitmap(s.Width, s.Height, x);
Graphics g = Graphics.FromImage(bit);
g.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);
printDocument1.Print();
}
可以打印加保存 可是打印的是当时的界面 怎么让它打印我订购的电影票(电影名字,时间,座位)
private void printDocument1_EndPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
MessageBox.Show("打印结束了");
}
Bitmap bit;
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(bit, 0, 0);
} private void 打印ToolStripMenuItem_Click(object sender, EventArgs e)
{
Graphics x = this.CreateGraphics();
Size s = this.Size;
bit = new Bitmap(s.Width, s.Height, x);
Graphics g = Graphics.FromImage(bit);
g.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);
printDocument1.Print();
}
可以打印加保存 可是打印的是当时的界面 怎么让它打印我订购的电影票(电影名字,时间,座位)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货