Exemple #1
0
        private void 打印ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PrintDialog MyprintDg = new PrintDialog();

            MyprintDg.Document = MyPrintDc;
            MyPrintDc.Print();
        }
Exemple #2
0
        private void 打印ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PrintDialog MyprintDg = new PrintDialog();

            MyprintDg.Document = MyPrintDc;
            if (MyprintDg.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    MyPrintDc.Print();
                }
                catch
                {
                    MyPrintDc.PrintController.OnEndPrint(MyPrintDc, new System.Drawing.Printing.PrintEventArgs());
                }
            }
        }