www.pudn.com > PrintDataGridViewDemo.rar > WHPrintPreview.cs, change:2011-04-27,size:1373b


´╗┐using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Diagnostics; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 
namespace ColorDemo 
{ 
    public partial class WHPrintPreview : PrintPreviewDialog 
    { 
        public WHPrintPreview() 
        { 
            InitializeComponent(); 
        } 
 
        public WHPrintPreview(IContainer container) 
        { 
            container.Add(this); 
 
            InitializeComponent(); 
        } 
        private void PreviewInvalidate() 
        { 
            this.PrintPreviewControl.InvalidatePreview(); 
        } 
        private void btnPrinterSet_Click(object sender, EventArgs e) 
        { 
            PrintDialog pDialog = new PrintDialog(); 
            pDialog.Document = this.Document; 
            pDialog.ShowDialog(); 
        } 
 
        private void btnPageSetup_Click(object sender, EventArgs e) 
        { 
 
            PageSetupDialog pageSetup = new PageSetupDialog(); 
            pageSetup.Document = this.Document; 
            pageSetup.ShowDialog(); 
        } 
 
        private void btnPrintPreview_Click(object sender, EventArgs e) 
        { 
            PreviewInvalidate(); 
        } 
 
        private void btnPrint_Click(object sender, EventArgs e) 
        { 
            this.Document.Print(); 
        } 
    } 
}