public void openBox() { System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument(); pd.PrintController = new StandardPrintController(); pd.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.openBox2_PrintPage); //PrintPreviewDialog ppdig = new PrintPreviewDialog(); //ppdig.Document = pd; //ppdig.ShowDialog(); pd.Print(); }