コード例 #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (this.objectListView == null || this.Overlay == null)
            {
                return;
            }

            Graphics g = e.Graphics;

            g.TextRenderingHint = ObjectListView.TextRenderingHint;
            g.SmoothingMode     = ObjectListView.SmoothingMode;
            //g.DrawRectangle(new Pen(Color.Green, 4.0f), this.ClientRectangle);

            // If we are part of an MDI app, make sure we don't draw outside the bounds
            if (this.mdiClient != null)
            {
                Rectangle r  = mdiClient.RectangleToScreen(mdiClient.ClientRectangle);
                Rectangle r2 = this.objectListView.RectangleToClient(r);
                g.SetClip(r2, System.Drawing.Drawing2D.CombineMode.Intersect);
            }

            this.Overlay.Draw(this.objectListView, g, this.objectListView.ClientRectangle);
        }