Exemple #1
0
        public DialogResult ShowPageSetupDialog()
        {
            var psd = new PageSetupDialog();

            psd.AllowPrinter    = true;
            psd.PageSettings    = PageSettings;
            psd.PrinterSettings = PageSettings.PrinterSettings;
            return(psd.ShowDialog(window));
        }
Exemple #2
0
        public void SettingDocument()
        {
            PageSetupDialog setup = new PageSetupDialog();

            setup.Document        = this.document;
            setup.PageSettings    = this.pageSettings;
            setup.PrinterSettings = this.printSettings;
            setup.ShowDialog();
        }
Exemple #3
0
 private void method_1()
 {
     this.pageSetupDialog1 = new PageSetupDialog()
     {
         PageSettings    = new PageSettings(),
         PrinterSettings = new PrinterSettings(),
         ShowNetwork     = false
     };
 }
Exemple #4
0
        private void izbornikPageSetup_Click(object sender, EventArgs e)
        {
            PageSetupDialog pageSetup = new PageSetupDialog();

            if (pageSetup.ShowDialog() == DialogResult.OK)
            {
                pageSetup.ShowDialog();
            }
        }
Exemple #5
0
        private void izbornikPageSetup_Click(object sender, EventArgs e)
        {
            PageSetupDialog pageSetupDialog1 = new PageSetupDialog();

            pageSetupDialog1.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
            pageSetupDialog1.PageSettings    = new System.Drawing.Printing.PageSettings();
            pageSetupDialog1.EnableMetric    = false;
            pageSetupDialog1.ShowDialog();
        }
Exemple #6
0
        private void ページ設定UToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageSetupDialog psd = new PageSetupDialog();

            psd.EnableMetric    = true; //cf. KB814355 et http://dobon.net/vb/dotnet/graphics/pagesetupdialogbug.html
            psd.PageSettings    = GlobalData.Instance.pageSettings;
            psd.PrinterSettings = GlobalData.Instance.printerSettings;
            psd.AllowMargins    = false;
            psd.ShowDialog();
        }
        private void PrintDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Bitmap bm = new Bitmap(this.Panel1.Width, this.Panel1.Height);

            Panel1.DrawToBitmap(bm, new Rectangle(0, 0, this.Panel1.Width, this.Panel1.Height));
            e.Graphics.DrawImage(bm, 3, 0);
            PageSetupDialog aPS = new PageSetupDialog();

            aPS.Document = PrintDocument1;
        }
Exemple #8
0
        public Task <bool> OnEvent(object MapEvent)
        {
            PageSetupDialog dlg = new PageSetupDialog();

            dlg.Document = PrinterPage.Document;

            dlg.ShowDialog();

            return(Task.FromResult(true));
        }
Exemple #9
0
 private void InitializePageSetupDialog()
 {
     //实例化打印设置对话框
     m_pageSetupDialog = new PageSetupDialog();
     //初始化打印设置对话框属性
     m_pageSetupDialog.PageSettings    = new System.Drawing.Printing.PageSettings();
     m_pageSetupDialog.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
     //不显示Network
     m_pageSetupDialog.ShowNetwork = false;
 }
Exemple #10
0
        void OnPrintSetupClick(object sender, EventArgs e)
        {
            PageSetupDialog pageSetupDialog = new PageSetupDialog();

            pageSetupDialog.PageSettings     = _pageSettings;
            pageSetupDialog.PrinterSettings  = _printerSettings;
            pageSetupDialog.AllowOrientation = true;
            pageSetupDialog.AllowMargins     = true;
            pageSetupDialog.ShowDialog();
        }
Exemple #11
0
        public void PageSetupDialog_MinMargins_ShouldSerializeValue_ReturnsExpected(Margins value, bool expected)
        {
            var dialog = new PageSetupDialog();
            PropertyDescriptor property = TypeDescriptor.GetProperties(typeof(PageSetupDialog))[nameof(PageSetupDialog.MinMargins)];

            Assert.False(property.ShouldSerializeValue(dialog));

            dialog.MinMargins = value;
            Assert.Equal(expected, property.ShouldSerializeValue(dialog));
        }
Exemple #12
0
        // 页面设置菜单按钮
        private void pageSettingMenuItem_Click(object sender, EventArgs e)
        {
            PageSetupDialog pageSetupDialog = new PageSetupDialog();

            pageSetupDialog.PageSettings = pageSettings;
            if (pageSetupDialog.ShowDialog() == DialogResult.OK)
            {
                pageSettings = pageSetupDialog.PageSettings;
            }
        }
Exemple #13
0
        public DialogResult ShowPageSetupDialog(IWin32Window owner)
        {
            PageSetupDialog psd = new PageSetupDialog();

            psd.AllowPrinter    = true;
            psd.PageSettings    = PageSettings;
            psd.PrinterSettings = PageSettings.PrinterSettings;

            return(psd.ShowDialog(owner));
        }
        // ------------------------------------------------------------------
        /// <summary>
        /// Displays a PageSetupDialog so the user can specify how each
        /// page is printed.
        /// </summary>
        // ------------------------------------------------------------------
        public void PageSetup()
        {
            PageSetupDialog dialog = new PageSetupDialog();

            dialog.PageSettings = this.PageSettings;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                this.PageSettings = dialog.PageSettings;
            }
        }
Exemple #15
0
        private void ustawieniaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageSetupDialog pgSetup = new PageSetupDialog();

            pgSetup.PageSettings    = new System.Drawing.Printing.PageSettings();
            pgSetup.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
            pgSetup.ShowNetwork     = false;

            pgSetup.ShowDialog();
        }
Exemple #16
0
        public static DialogResult PageSettings()
        {
            //Read and modify document page settings
            PageSetupDialog dlg = new PageSetupDialog();

            dlg.AllowMargins = dlg.AllowOrientation = dlg.AllowPaper = true;
            dlg.AllowPrinter = false;           //PrinterSettings=null disables AllowPrinter
            dlg.PageSettings = UltraGridPrinter.Settings;
            return(dlg.ShowDialog());
        }
Exemple #17
0
        private void pageSettingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var             pd  = new PrintDocument();
            PageSetupDialog psd = new PageSetupDialog();

            psd.Document = pd;
            psd.ShowDialog();

            _pageSettings = pd.DefaultPageSettings;
        }
Exemple #18
0
        private void pageSetUptoolStrip_LauncherClick(object sender, EventArgs e)
        {
            PageSetupDialog pg = new PageSetupDialog();

            pg.Document = printDocument;
            if (pg.ShowDialog() == DialogResult.OK)
            {
                ApplyPageSettings(pg);
            }
        }
Exemple #19
0
        private void menuItem4_Click(object sender, System.EventArgs e)
        {
            //构造页面设置对话框
            PageSetupDialog pageSetupDialog1 = new PageSetupDialog();

            //设置Document属性
            pageSetupDialog1.Document = this.pDoc;
            //显示对话框
            pageSetupDialog1.ShowDialog();
        }
Exemple #20
0
        //File.Page Setup
        private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var PageSetupDialog = new PageSetupDialog();

            PageSetupDialog.PageSettings = PageSettings;
            if (PageSetupDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            PageSettings = PageSetupDialog.PageSettings;
        }
Exemple #21
0
 private void SelectCustomPaper(LabelPrintDocument engine, PageSetupDialog pageDialog1)
 {
     for (int index = 0; index < engine.PrinterSettings.PaperSizes.Count; index++)
     {
         if (engine.PrinterSettings.PaperSizes[index].PaperName == Settings.Label.PrinterSettings.Paper)
         {
             PaperSize size = engine.PrinterSettings.PaperSizes[index];
             pageDialog1.PageSettings.PaperSize = size;
         }
     }
 }
Exemple #22
0
        private void filePageSetupMenuItem_Click(Object sender,
                                                 EventArgs e)
        {
            PageSetupDialog pageSetupDialog = new PageSetupDialog();

            pageSetupDialog.PageSettings     = pgSettings;
            pageSetupDialog.PrinterSettings  = prtSettings;
            pageSetupDialog.AllowOrientation = true;
            pageSetupDialog.AllowMargins     = true;
            pageSetupDialog.ShowDialog();
        }
Exemple #23
0
 /// <summary>
 /// Setup the Page for printing
 /// </summary>
 private void _miFilePageSetup_Click(object sender, System.EventArgs e)
 {
     try
     {
         _printPage = 1;
         PageSetupDialog dlg = new PageSetupDialog();
         dlg.Document = _printDocument;
         dlg.ShowDialog(this);
     }
     catch { }
 }
Exemple #24
0
        private void menuitemFilePageSetup_Click(object sender, EventArgs e)
        {
            var PageSetupDialog = new PageSetupDialog();

            PageSetupDialog.PageSettings = PageSettings;
            if (PageSetupDialog.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            PageSettings = PageSetupDialog.PageSettings;
        }
Exemple #25
0
        private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageSetupDialog pgsetup = new PageSetupDialog();

            pgsetup.PageSettings     = new System.Drawing.Printing.PageSettings();
            pgsetup.PrinterSettings  = new System.Drawing.Printing.PrinterSettings();
            pgsetup.ShowNetwork      = false;
            pgsetup.AllowMargins     = true;
            pgsetup.AllowOrientation = true;
            pgsetup.ShowDialog();
        }
Exemple #26
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            //page setup menu
            PageSetupDialog pageSetupDialog = new PageSetupDialog();

            pageSetupDialog.PageSettings     = pgSettings;
            pageSetupDialog.PrinterSettings  = prtSettings;
            pageSetupDialog.AllowOrientation = true;
            pageSetupDialog.AllowMargins     = true;
            pageSetupDialog.ShowDialog();
        }
Exemple #27
0
        void TsbPrintSetup_Click(object sender, EventArgs e)
        {
            var dlg = new PageSetupDialog();

            dlg.Document = PrintDocument;
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                PrintDocument.DefaultPageSettings = dlg.PageSettings;
                previewControl.InvalidatePreview();
            }
        }
Exemple #28
0
        private void 页面设置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageSetupDialog MyPageSetupDg = new PageSetupDialog();

            MyPageSetupDg.Document = MyPrintDc;
            try
            {
                MyPageSetupDg.ShowDialog();
            }
            catch { }
        }
Exemple #29
0
 private void InitializePageSetupDialog()
 {
     //create a new PageSetupDialog using constructor
     pageSetupDialog1 = new PageSetupDialog();
     //initialize the dialog's PrinterSettings property to hold user defined printer settings
     pageSetupDialog1.PageSettings = new System.Drawing.Printing.PageSettings();
     //initialize dialog's PrinterSettings property to hold user set printer settings
     pageSetupDialog1.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
     //do not show the network in the printer dialog
     pageSetupDialog1.ShowNetwork = false;
 }
Exemple #30
0
 private void PageSetupButton_Click(object sender, EventArgs e)
 {
     using (PageSetupDialog dialog = new PageSetupDialog())
     {
         dialog.Document = base.Document;
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             base.Document.DefaultPageSettings = dialog.PageSettings;
         }
     }
 }
Exemple #31
0
 /*
  *                     if (bingoTable.printCallList == true)
             {
                 printBingoCallList(pt, sz, bingoTable, Color.Black, ref graphicsObj, licenseInfo, "Oranges are pink", false);
                 //print the call list here - msk
             }
             bingoTable.RandSeed = 0;
  * */
 public BingoPrint()
 {
     printBingoDocument = new PrintDocument();
     //printCallList = new PrintDocument();
     printBingoPreviewDialog = new PrintPreviewDialog();
     printBingoDialog = new PrintDialog();
     pageBingoSetupDialog = new PageSetupDialog();
     PrintPageSettings = new PageSettings();
     printBingoDocument.PrintPage += new PrintPageEventHandler(this.PrintPage);
        // printCallList.PrintPage += new PrintPageEventHandler(this.PrintCallList);
        //printBingoDocument.QueryPageSettings += new QueryPageSettingsEventHandler(this.QueryPageSettings);
     numCardsToPrint = 0;
     return;
 }