Ejemplo n.º 1
0
        private bool RefreshPageSettings()
        {
            if (myPageSettings != null)
            {
                XPaperSize Size = this.cboPage.SelectedItem as XPaperSize;
                if (Size != null)
                {
                    myPageSettings.PaperSize = Size;
                }
                if (Size == null || myPageSettings.PaperSize.Kind == System.Drawing.Printing.PaperKind.Custom)
                {
                    int vWidth  = (int)(MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtWidth.Value)));
                    int vHeight = (int)(MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtHeight.Value)));
                    myPageSettings.PaperSize = new XPaperSize(System.Drawing.Printing.PaperKind.Custom, vWidth, vHeight);
                }


                myPageSettings.Margins.Left   = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtLeftMargin.Value));
                myPageSettings.Margins.Top    = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtTopMargin.Value));
                myPageSettings.Margins.Right  = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtRightMargin.Value));
                myPageSettings.Margins.Bottom = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtBottomMargin.Value));
                myPageSettings.Landscape      = this.rdoLandscape2.Checked;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private bool RefreshPageSettings()
        {
            if (myPageSettings != null)
            {
                myPageSettings.PaperKind = ( PaperKind )Enum.Parse(typeof(PaperKind), cboPage.Text);
                if (myPageSettings.PaperKind == PaperKind.Custom)
                {
                    myPageSettings.PaperWidth  = (int)(MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtWidth.Value)));
                    myPageSettings.PaperHeight = (int)(MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtHeight.Value)));
                }

                myPageSettings.LeftMargin   = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtLeftMargin.Value));
                myPageSettings.TopMargin    = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtTopMargin.Value));
                myPageSettings.RightMargin  = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtRightMargin.Value));
                myPageSettings.BottomMargin = (int)MeasureConvert.MillimeterToHundredthsInch(Convert.ToDouble(this.txtBottomMargin.Value));
                myPageSettings.Landscape    = this.rdoLandscape2.Checked;
                return(true);
            }
            else
            {
                return(false);
            }
        }