如题

解决方案 »

  1.   

    现在不知道用什么来做打印模板,就象webform里的xslt+xml一样,有谁有做过这方面的东西的
      

  2.   

    nozaomi(满满) ( ) 信誉:100    Blog  2006-12-19 13:24:24  得分: 0  
     
     
       应该只能一个一个控键打
      
     
    这样做法,如果窗体上有上千个控件,对位置麻烦了,有简便的方法吗
      

  3.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication3
    {
        public partial class Form1 : Form
        {
            private Image myFormImage;
            public Form1()
            {
                InitializeComponent();
            }
            private void printForm()
            {
                myFormImage = new Bitmap(this.Width, this.Height);            Graphics g = Graphics.FromImage(myFormImage);
                g.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, this.Size);
            }
            private void button1_Click(object sender, EventArgs e)
            {
                printForm();            this.printPreviewDialog1.Document = this.printDocument1;
                this.printPreviewDialog1.ShowDialog(this);        }        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
            {
                e.Graphics.DrawImage(this.myFormImage, 0, 0);
            }
            private static void Main()
            {
                Application.Run(new Form1());
            }
        }
    }
      

  4.   

    to:feixue_XXXX(飞雪)
    你这个方法是否能分页打印呢
      

  5.   

    把整个form用抓图抓出来 再打印这个图 就ok