winform打印,如何在预览后打印时不再出现选择打印提示框,直接打印

解决方案 »

  1.   

    rpt_Quote1.PrintToPrinter(1,true,1,99999);
      

  2.   

    不出现吧,你用PrintDialog控件了吧?
    private void button1_Click(object sender, System.EventArgs e)
    {
    printPreviewDialog1.Document = printDocument1;
    printPreviewDialog1.ShowDialog();
    }private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
    // print
    }
    没出现呀?
      

  3.   

    rpt_Quote1.PrintToPrinter(1,true,1,99999);
    他还是出呀,是直接打了,但无法阻止提示框出现
      

  4.   

    MIS金质打印通,打印时不要出现打印提示框,直接打印 请修改MisGoldPrinter.cs
    源码:www.webmis.com.cn/// <summary>
    /// 打印或显示设置对话框确定后打印。
    /// </summary>
    public System.Drawing.Printing.PrinterSettings PrintSetup()
    {
    this.mCurrentPageIndex = 1;
    this.mCurrentRowIndex = 0; PrinterPageSetting printerPageSetting;
    printerPageSetting = new PrinterPageSetting(mPrintDocument);
    printerPageSetting.PrintPage += new PrintPageDelegate(this.PrintPageEventHandler); return printerPageSetting.ShowPrintSetupDialog();
    }/// <summary>
    /// 打印或显示设置对话框确定后打印。
    /// </summary>
    public void Print()
    {
    //直接打印
    this.mCurrentPageIndex = 1;
    this.mCurrentRowIndex = 0; this.mPrintDocument.PrintPage+=new System.Drawing.Printing.PrintPageEventHandler(PrintPageEventHandler); try
    {
    this.mPrintDocument.Print();
    }
    catch(Exception ex)
    {
    //Console.WriteLine(ex.Message);
    System.Windows.Forms.MessageBox.Show("打印机错误!\n","MIS金质打印通 www.webmis.com.cn");
    }