zoukankan      html  css  js  c++  java
  • C# winform 打印当前窗体

    private void btnPrint_Click(object sender, EventArgs e)
            {
                SendKeys.Send("%{PRTSC}");
                Application.DoEvents();
                this.printDocument1.Print();  
            }

            private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
            {
                IDataObject iData = Clipboard.GetDataObject();
                Image img = (Image)iData.GetData(DataFormats.Bitmap);
                e.Graphics.DrawImage(img, 0, 0);
            }
     
        private void button2_Click(object sender, EventArgs e)
            {
                this.printPreviewDialog1.Document = this.printDocument1;  //设置需要预览的文档
                this.printPreviewDialog1.ShowDialog();                  
            }
  • 相关阅读:
    杂篇章
    敲代码中遇到的小问题
    数组的运用
    java中强大的免费的集成开发环境(IDE)eclipse的使用技巧及注意事项
    流程
    博客目录
    pgk
    gogs
    github相关
    axios记录
  • 原文地址:https://www.cnblogs.com/conquer/p/1486288.html
Copyright © 2011-2022 走看看