public MainWindow() { InitializeComponent(); Icon = Resources.printer_and_fax_w; printPreview = new PrintPreview(); printPreview.Anchor = this.dummyButton.Anchor; printPreview.BackColor = this.dummyButton.BackColor; printPreview.Location = this.dummyButton.Location; printPreview.Margin = this.dummyButton.Margin; printPreview.Name = "printPreview"; printPreview.Size = this.dummyButton.Size; printPreview.TabIndex = 1;// this.dummyButton.TabIndex; printPreview.TabStop = true; if (LicenseManager.UsageMode != LicenseUsageMode.Designtime) { this.panelRight.Controls.Remove(this.dummyButton); this.panelRight.Controls.Add(this.printPreview); printersCB.Enabled = false; paperSizesCB.Enabled = false; } }
public MainWindow() { InitializeComponent(); Icon = Resources.printer_and_fax_w; printPreview = new PrintPreview(); printPreview.Dock = this.dummyButton.Dock; printPreview.Anchor = this.dummyButton.Anchor; printPreview.BackColor = this.dummyButton.BackColor; printPreview.Location = this.dummyButton.Location; printPreview.Margin = this.dummyButton.Margin; printPreview.Name = "printPreview"; printPreview.Size = this.dummyButton.Size; printPreview.MinimumSize = new Size(0, 0); printPreview.TabIndex = 1; printPreview.TabStop = true; printPreview.KeyUp += (s, e) => { switch (e.KeyCode) { case Keys.F5: printPreview.Invalidate(true); Core.Helpers.Logging.TraceMessage("-------- F5 ---------"); Task.Run(() => printPreview.SheetViewModel.LoadAsync(printPreview.SheetViewModel.File).ConfigureAwait(false)); break; } }; if (LicenseManager.UsageMode != LicenseUsageMode.Designtime) { this.panelRight.Controls.Remove(this.dummyButton); this.panelRight.Controls.Add(this.printPreview); printersCB.Enabled = false; paperSizesCB.Enabled = false; } }