请教:如何在winform中设置一个窗体,窗体的格式类似个人的简历,是个表格,里面有文本数据和图片。其中图片存在磁盘上,数据在数据库中。其格式就像 个人信息表。如何设置。用什么控件,如何实现,怎么做才能显示,并且打印。如果搞定还有分!!!

解决方案 »

  1.   

    可以考虑截屏,截取你整个WinForm窗体,保存成jpg图片,然后再打印(这时就可以用系统自带的打印功能了)
      

  2.   

    我个人建议楼主直接在窗体中用控件构建出你所要的个人信息表,然后可以打印出整个个人信息表窗体.参考代码如下:我不喜欢使用别人的控件,只是拿来学习,呵呵.当然这种控件也不知道怎么找,个人信息控件????using System;
    using System.Windows.Forms;
    using System.Drawing;
    using System.Drawing.Printing;public class Form1 :
        Form
    {
        private Button printButton = new Button();
        private PrintDocument printDocument1 = new PrintDocument();    public Form1()
        {
            printButton.Text = "Print Form";
            printButton.Click += new EventHandler(printButton_Click);
            printDocument1.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
            this.Controls.Add(printButton);
        }    void printButton_Click(object sender, EventArgs e)
        {
            CaptureScreen();
            printDocument1.Print();
        }    //获取整个窗体的内容.
        Bitmap memoryImage;    private void CaptureScreen()
        {
            Graphics myGraphics = this.CreateGraphics();
            Size s = this.Size;
            memoryImage = new Bitmap(s.Width, s.Height, myGraphics);
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
            memoryGraphics.CopyFromScreen(this.Location.X, this.Location.Y, 0, 0, s);
        }    private void printDocument1_PrintPage(System.Object sender,  
               System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawImage(memoryImage, 0, 0);
        }

        public static void Main()
        {
            Application.Run(new Form1());
        }
    }
      

  3.   

    我想也许可以导入到excel中再打印。
    几年前我一次领某考试的准考证时发现准考证居然是用excel管理打印的,呵呵,可见其功能够强大,可能比找控件更方便些??