Esempio n. 1
0
 /// <summary>
 /// This shows the pageSetup dialog
 /// </summary>
 public void ShowPageSetupDialog()
 {
     if (_printerSettings.IsValid)
     {
         PageSetupForm setupFrom = new PageSetupForm(_printerSettings);
         setupFrom.ShowDialog(this);
         Invalidate();
     }
     else
     {
         MessageBox.Show("The default printer settings seem to indicate No printers are installed or the Print Spooler service is not running.");
     }
 }
Esempio n. 2
0
        /// <summary>
        /// This is the constructor, it makes a LayoutControl
        /// </summary>
        public LayoutControl()
        {
            InitializeComponent();
            _printerSettings = new PrinterSettings();
            _fileName = string.Empty;
            _suppressLEinvalidate = false;

            if (_printerSettings.IsValid)
            {
                //This code is used to speed up drawing because for some reason accessing .PaperSize is slow with its default value
                //I know its ugly but it speeds things up from 80ms to 0ms
                PageSetupForm tempForm = new PageSetupForm(_printerSettings);
                tempForm.OK_Button_Click(null, null);

                _drawingQuality = SmoothingMode.HighQuality;
                _zoom = 1;
                ZoomFitToScreen();
            }
            else
            {
                MessageBox.Show("The default printer settings seem to indicate No printers are installed or the Print Spooler service is not running.");
            }
        }