对此领域一窍不通,还请高手赐教.能给代码!!!

解决方案 »

  1.   

    用第三方控件,我有实例,请联系[email protected]
      

  2.   


            private void vistaButton1_Click(object sender, EventArgs e)
            {
                PrintDocument pd = new PrintDocument();
                pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
                PrintPreviewDialog cppd = new PrintPreviewDialog();
                cppd.Document = pd;
                cppd.ShowDialog();
            }        void pd_PrintPage(object sender, PrintPageEventArgs e)
            {
                Graphics g = e.Graphics;
                Rectangle rect = barcodeControl2.ClientRectangle;
                //下面是调整打印位置的代码。
                rect = new Rectangle(rect.X + (int)numericUpDown2.Value, rect.Y + (int)numericUpDown3.Value, rect.Width, rect.Height);
                //打印
                barcodeControl2.Draw(g, rect, GraphicsUnit.Inch, 0.01f, 0, null);
                g.Dispose();
            }
    using Cobainsoft.Windows.Forms;
    在工具栏,加入dll,然后就可以拖到form上.