コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: hewness/netdev812
        frmPrint printform = null;    // New Class Variable

        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            BackgroundWorker printthread = new BackgroundWorker();

            printthread.DoWork                    += Print;
            printthread.ProgressChanged           += PrintProgress;
            printthread.RunWorkerCompleted        += PrintCompleted;
            printthread.WorkerReportsProgress      = true;
            printthread.WorkerSupportsCancellation = true;

            printform = new frmPrint(printthread); // Create form
            printthread.RunWorkerAsync();          // Call DoWork()
            // Display form, if cancelled say so
            if (printform.ShowDialog() == false)
            {
                MessageBox.Show("Printing Aborted");
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: hewness/netdev812
        frmPrint printform = null;    // New Class Variable

        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            BackgroundWorker printthread = new BackgroundWorker();
            printthread.DoWork += Print;
            printthread.ProgressChanged += PrintProgress;
            printthread.RunWorkerCompleted += PrintCompleted;
            printthread.WorkerReportsProgress = true;
            printthread.WorkerSupportsCancellation = true;

            printform = new frmPrint(printthread); // Create form
            printthread.RunWorkerAsync();  // Call DoWork()
            // Display form, if cancelled say so
            if (printform.ShowDialog() == false)
                MessageBox.Show("Printing Aborted");
        }