在一个显示详细信息的窗体,每个label标签后面跟一个TextBox,在最后有几个按钮,如何完成打印及打印预览功能(最后面的几个button不用打印了),要一个比较详细的代码。
这里用的的打印控件就用工具箱中的那几个就行了。
这里用的的打印控件就用工具箱中的那几个就行了。
解决方案 »
- 求助 MSMQ消息加密的问题 急
- 高分求解:NickLee.Web.UI的treeview控件设置了CSS,在IE6下无效,在IE7和傲游器下是正常显示的!!
- hashtable的一个值如何使用带参的ToString()
- 循环取数问题,得不到最大的数字
- 关于dataGirdView设置分页问题
- C#中如何用数组同时存贮多个字段啊
- 如何将dataset中datatable里的记录添加到数据库表中?急!
- 关于类中函数调用的一个小问题?请教!
- 请问有没有winformC#环境下PKI公钥加密体系的应用例子?
- C#应用程序安装在win98下,窗口的大小改变问题 ,急! 在线等待
- 这样的时间如何比较?
- c#可以实现opengl来调用3ds文件进行显示么?
private void PrinttoolStripMenuItem_Click(object sender, EventArgs e)
{
//实现打印
int width =this.Width+60;
int height = this.Height; print = new Bitmap(width, height);
Graphics g = Graphics.FromImage(print);
Size tmpSize;
tmpSize = this.Size;
tmpSize.Height = tmpSize.Height-60;
tmpSize.Width = tmpSize.Width;
g.CopyFromScreen(this.Location.X+6, this.Location.Y + 55, 80, 30, tmpSize); this.printPreviewDialog.Document = this.printDocument;
this.printPreviewDialog.ShowDialog(this);
} private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(print, 0, 0);
}
private void PrinttoolStripMenuItem_Click(object sender, EventArgs e)
{
//实现打印
int width =this.Width+60;
int height = this.Height; print = new Bitmap(width, height);
Graphics g = Graphics.FromImage(print);
Size tmpSize;
tmpSize = this.Size;
tmpSize.Height = tmpSize.Height-60;
tmpSize.Width = tmpSize.Width;
g.CopyFromScreen(this.Location.X+6, this.Location.Y + 55, 80, 30, tmpSize); this.printPreviewDialog.Document = this.printDocument;
this.printPreviewDialog.ShowDialog(this);
} private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(print, 0, 0);
}
PrinttoolStripMenuItem_Click是哪个控件的单击事件?