Beispiel #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (UI.IsControlPaintingEnabled(this))
            {
                Size      itemSize      = ItemSize;
                Rectangle firstItemRect = new Rectangle(-this.scrollOffset, 0, itemSize.Width, itemSize.Height);

                for (int i = 0; i < this.items.Count; ++i)
                {
                    if (IsItemVisible(i))
                    {
                        Point itemOffset = new Point(firstItemRect.X + itemSize.Width * i, firstItemRect.Y);
                        DrawItem(e.Graphics, this.items[i], itemOffset);
                    }
                }
            }

            base.OnPaint(e);
        }