Пример #1
0
        public void UpdatePages()
        {
            PreviewPages.Clear();
            if (FLayoutLocked)
            {
                return;
            }

            for (int i = 0; i < PreparedPages.Count; i++)
            {
                SizeF pageSize = PreparedPages.GetPageSize(i);
                PreviewPages.AddPage(pageSize, Zoom);
            }
            PreviewPages.LayoutPages(Width - SystemInformation.VerticalScrollBarWidth);
            FLocked = false;
            UpdatePageNumbers();

            Size maxSize = PreviewPages.GetMaxSize();

            if (maxSize.Width > Width)
            {
                maxSize.Height += SystemInformation.HorizontalScrollBarHeight;
            }
            if (maxSize.Height > Height)
            {
                maxSize.Width += SystemInformation.VerticalScrollBarWidth;
            }
            AutoScrollMinSize = maxSize;

            SetPageNo(PageNo, false);
            Refresh();
        }