A reason that I think ClientRectangle contains border is result of attached testcase.

Result:
Linux
  Label.Bounds: {X=0,Y=0,Width=100,Height=23}
  Label.ClientRect: {X=0,Y=0,Width=100,Height=23}
  Panel.Bounds: {X=0,Y=0,Width=200,Height=100}
  Panel.ClientRect: {X=0,Y=0,Width=200,Height=100}

Windows (mono)
  Label.Bounds: {X=0,Y=0,Width=100,Height=23}
  Label.ClientRect: {X=0,Y=0,Width=100,Height=23}
  Panel.Bounds: {X=0,Y=0,Width=200,Height=100}
  Panel.ClientRect: {X=0,Y=0,Width=200,Height=100}

Windows (MS)
  Label.Bounds: {X=0,Y=0,Width=100,Height=23}
  Label.ClientRect: {X=0,Y=0,Width=98,Height=21}
  Panel.Bounds: {X=0,Y=0,Width=200,Height=100}
  Panel.ClientRect: {X=0,Y=0,Width=198,Height=98}

I think this difference have influence on Bug#76044.

--
Kazuki
using System;
using System.Drawing;
using System.Windows.Forms;

class TestCase : Form
{
        [STAThread]
        static void Main(string[] args)
        {
                Application.Run (new TestCase ());
        }

        Label label;
        Panel panel;

        TestCase ()
        {
                label = new Label ();
                panel = new Panel ();

                label.BorderStyle = BorderStyle.FixedSingle;
                panel.BorderStyle = BorderStyle.FixedSingle;

                Controls.Add (label);
                Controls.Add (panel);
        }

        protected override void OnPaint(PaintEventArgs e)
        {
                base.OnPaint (e);

                Console.WriteLine ("Label.Bounds: {0}", label.Bounds);
                Console.WriteLine ("Label.ClientRect: {0}", 
label.ClientRectangle);

                Console.WriteLine ("Panel.Bounds: {0}", panel.Bounds);
                Console.WriteLine ("Panel.ClientRect: {0}", 
panel.ClientRectangle);
        }

}
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to