如何把winform整个打印出来,多谢各位 没做过``这样做可以嘛:自己写个截图``以form得各个顶点得坐标为参数``如果有不规则皮肤组件``就不好弄了`` 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //--------------------------------------------// PrintableForm.cs ?2001 by Charles Petzold//--------------------------------------------using System;using System.Drawing;using System.Drawing.Printing;using System.Windows.Forms;class PrintableForm: Form{ public static void Main() { Application.Run(new PrintableForm()); } public PrintableForm() { Text = "Printable Form"; BackColor = SystemColors.Window; ForeColor = SystemColors.WindowText; ResizeRedraw = true; } protected override void OnPaint(PaintEventArgs pea) { DoPage(pea.Graphics, ForeColor, ClientSize.Width, ClientSize.Height); } protected override void OnClick(EventArgs ea) { PrintDocument prndoc = new PrintDocument(); prndoc.DocumentName = Text; prndoc.PrintPage += new PrintPageEventHandler(PrintDocumentOnPrintPage); prndoc.Print(); } void PrintDocumentOnPrintPage(object obj, PrintPageEventArgs ppea) { Graphics grfx = ppea.Graphics; SizeF sizef = grfx.VisibleClipBounds.Size; DoPage(grfx, Color.Black, (int)sizef.Width, (int)sizef.Height); } protected virtual void DoPage(Graphics grfx, Color clr, int cx, int cy) { Pen pen = new Pen(clr); grfx.DrawLine(pen, 0, 0, cx - 1, cy - 1); grfx.DrawLine(pen, cx - 1, 0, 0, cy - 1); }} 按照Macosx(咋就不结贴呢)的做法...打印出一个大叉.... 关于IE显示成windows窗口的设计 请教一个winform程序与网页交互的问题 hibernate的错误,网页报错Server Error in '/' Application. 在CSDN找不到答案,还有什么论坛更好啊? 在window forms下创建LosFormatter实例报错 服务器标记的格式不正确 DataGrid与IList C#读 shapefile 中的dbf文件 关于c#线程的问题。 请问这样做可以吗?关于connection释放的问题? 好奇怪的问题啊 !!!!! 请问C# Excel的问题
// PrintableForm.cs ?2001 by Charles Petzold
//--------------------------------------------
using System;
using System.Drawing;
using System.Drawing.Printing;
using System.Windows.Forms;class PrintableForm: Form
{
public static void Main()
{
Application.Run(new PrintableForm());
}
public PrintableForm()
{
Text = "Printable Form";
BackColor = SystemColors.Window;
ForeColor = SystemColors.WindowText;
ResizeRedraw = true;
}
protected override void OnPaint(PaintEventArgs pea)
{
DoPage(pea.Graphics, ForeColor,
ClientSize.Width, ClientSize.Height);
}
protected override void OnClick(EventArgs ea)
{
PrintDocument prndoc = new PrintDocument(); prndoc.DocumentName = Text;
prndoc.PrintPage +=
new PrintPageEventHandler(PrintDocumentOnPrintPage);
prndoc.Print();
}
void PrintDocumentOnPrintPage(object obj, PrintPageEventArgs ppea)
{
Graphics grfx = ppea.Graphics;
SizeF sizef = grfx.VisibleClipBounds.Size; DoPage(grfx, Color.Black, (int)sizef.Width, (int)sizef.Height);
}
protected virtual void DoPage(Graphics grfx, Color clr, int cx, int cy)
{
Pen pen = new Pen(clr); grfx.DrawLine(pen, 0, 0, cx - 1, cy - 1);
grfx.DrawLine(pen, cx - 1, 0, 0, cy - 1);
}
}