Mick
Mon Jul 18 04:31:03 CDT 2005
That would appear to be a bug.
You can workaround it by setting the Clip Region of the graphics object to
your borderRectangle.
> borderRectangle.Inflate(-10, -10);
e.Graphics.Clip = new Region(borderRectangle);
> ControlPaint.DrawBorder(e.Graphics, borderRectangle,
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<marc.cueto@gmail.com> wrote in message
news:1121627948.505285.247210@f14g2000cwb.googlegroups.com...
> Thank you all for replying. I managed to get it going using this code
> sample:
> protected override void OnPaint(PaintEventArgs e)
> {
> base.OnPaint(e);
>
> Rectangle borderRectangle = this.ClientRectangle;
> borderRectangle.Inflate(-10, -10);
> ControlPaint.DrawBorder(e.Graphics, borderRectangle,
> System.Drawing.Color.Black, 1,
> System.Windows.Forms.ButtonBorderStyle.Solid,
> System.Drawing.Color.Black, 1,
> System.Windows.Forms.ButtonBorderStyle.Solid,
> System.Drawing.Color.Black, 1,
> System.Windows.Forms.ButtonBorderStyle.Solid,
> System.Drawing.Color.Black, 1,
> System.Windows.Forms.ButtonBorderStyle.Solid);
> }
> I have one last question though. The top, left and bottom borders
> connect fine but the left border seems to be a little off. The top and
> bottom borders run past the right border by about 1 pixel. What is the
> problem?
>