// Public members

        public override void PaintControl(ProgressBar control, ControlPaintArgs args)
        {
            args.PaintBackground();
            args.PaintBorder();

            args.ClipToBorder();

            PaintProgress(control, args);
        }
Пример #2
0
        // Public members

        public override void PaintControl(ListBox control, ControlPaintArgs e)
        {
            Rectangle borderRect = RenderUtilities.GetOuterBorderRectangle(control, e.StyleSheet.GetRuleset(control));

            if (ControlUtilities.GetVisibleScrollBars(control).HasFlag(ScrollBars.Vertical))
            {
                borderRect = new Rectangle(borderRect.X, borderRect.Y, borderRect.Width + SystemInformation.VerticalScrollBarWidth, borderRect.Height);
            }

            e.PaintBackground();

            if (!e.ParentDraw)
            {
                GraphicsState graphicsState = e.Graphics.Save();

                e.ClipToBorder(borderRect);

                PaintItems(control, e);

                e.Graphics.Restore(graphicsState);
            }

            e.PaintBorder(borderRect);
        }