コード例 #1
0
        protected override void OnLoad(EventArgs e)
        {
            cancelButton.Font = Font;
            try
            {
                m_viewerControl.CancelRendering(-1);
                AsyncReportOperation asyncReportOperation = new AsyncMainStreamRenderingOperation(m_viewerControl.Report, PageCountMode.Estimate, m_format.Name, m_deviceInfo, allowInternalRenderers: false, null);
                asyncReportOperation.Completed += OnExportComplete;
                m_viewerControl.BackgroundThread.BeginBackgroundOperation(asyncReportOperation);
            }
            catch (Exception ex)
            {
                ProcessOnLoadException(ex);
            }
            Point point = m_viewerControl.PointToScreen(Point.Empty);

            base.Left = point.X + Math.Max(0, (m_viewerControl.Width - base.Width) / 2);
            base.Top  = point.Y + Math.Max(0, (m_viewerControl.Height - base.Height) / 2);
        }