直接打印则需要调用PrintDocumnt.Print()方可打印,否按在对话框中点【打印】但不会有反应

private void Tsb_print_Click(object sender, EventArgs e)
        {
            printDialog1.Document = printDocument1;
            printDialog1.AllowSomePages = true;
            
            DialogResult result = printDialog1.ShowDialog();

            // If the result is OK then print the document.
            //打印预览时只要printPreviewDialog1.Document = printDocument1关联后就可的打印
            //直接打印则需要调用PrintDocumnt.Print()方可打印,否按在对话框中点【打印】但不会有反应
            if (result == DialogResult.OK)
            {
                printDocument1.Print();
            }

        }

 

posted @ 2020-10-23 17:22  windy3417  阅读(104)  评论(0编辑  收藏  举报