有一个form 里面有一个panel panel里面放了一些自定义控件 我现在要把这个panel全部打印下来要怎么弄???打印form的那些我看到了但是还是不会修改,。,。。谁能帮下·~~~

解决方案 »

  1.   

    http://topic.csdn.net/u/20100707/17/7d7d1b97-ffeb-49fa-9527-f9069d85a5d5.html
      

  2.   

    这个panel本身就2个Label+一个图片 
     private void PrintAgain_Click(object sender, EventArgs e)
            {
                if (iqr2.IsBadgePrinted)
                {
                    MessageBox.Show("");
                }
                this.iqr2.IsBadgePrinted = true;
                RefreshIQR2();
                CaptureScreen();
                //printDocument1.Print();
                this.IsBadgePrinted = true;
                savetheinfo();
            }        private void CaptureScreen()
            {
                Graphics gp = this.panel2.CreateGraphics();
                memoryImage = new Bitmap(this.panel2.Width, this.panel2.Height);
                Rectangle rect = new Rectangle(this.panel2.Location,this.panel2.Size);            this.panel2.DrawToBitmap(memoryImage, rect);            gp.DrawImage(memoryImage, panel2.Location);        }        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
            {
                e.Graphics.DrawImage(memoryImage, this.panel2.Location);  //原来是(XXXXXX,180,180);
            }panel2就是我要打印的panel我在原来的一个程序内打出来时对的 但是 放到新的winform里面 打出来的就是白纸谁知道什么原因
      

  3.   

    Graphics g = .panel2.CreateGraphics();            Bitmap bmp = new Bitmap(this..panel2.Size.Width, this.panel2.Height, g);
                this.panel2.DrawToBitmap(bmp, this..panel2.ClientRectangle);
                e.Graphics.DrawImage(bmp, 0, 0);如此试试呢