1 2 3 4 5 6 7 8 9 10 11 12
|
GroupBox box = (GroupBox)sender;
e.Graphics.Clear(SystemColors.Control);
float epaisseur = 4.0f;
e.Graphics.DrawString(box.Text, box.Font, new SolidBrush(Color.Black), new PointF(5, 0));
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Black), epaisseur), new Point(box.ClientRectangle.X, 5), new Point(box.ClientRectangle.X, box.ClientRectangle.Height)); //|
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Black), epaisseur), new Point(box.ClientRectangle.X + box.Width, 5), new Point(box.ClientRectangle.X + box.Width, box.ClientRectangle.Height)); //|
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Black), epaisseur), new Point(box.ClientRectangle.X, box.Height), new Point(box.ClientRectangle.X + box.Width, box.ClientRectangle.Height)); //_
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Black), epaisseur - 2), new Point(0, 5), new Point(5, 5));
e.Graphics.DrawLine(new Pen(new SolidBrush(Color.Black), epaisseur - 2), new Point(box.Text.Length * 7, 5), new Point(box.Width, 5)); |
Partager