G.DrawLine(borderPen, new Point(rect.X + + (int)(strSize.Width), rect.Y), new Point(rect.X + rect.Width, rect.Y)) įWIW, this is the implementation I used. G.DrawLine(borderPen, new Point(rect.X, rect.Y), new Point(rect.X +, rect.Y)) G.DrawLine(borderPen, new Point(rect.X, rect.Y + rect.Height), new Point(rect.X + rect.Width, rect.Y + rect.Height)) G.DrawLine(borderPen, new Point(rect.X + rect.Width, rect.Y), new Point(rect.X + rect.Width, rect.Y + rect.Height)) G.DrawLine(borderPen, rect.Location, new Point(rect.X, rect.Y + rect.Height)) G.DrawString(box.Text, box.Font, textBrush,, 0) Rectangle rect = new Rectangle(,īox.ClientRectangle.Y + (int)(strSize.Height / 2),īox.ClientRectangle.Height - (int)(strSize.Height / 2) - 1) ![]() ![]() SizeF strSize = g.MeasureString(box.Text, box.Font) Private void DrawGroupBox(GroupBox box, Graphics g, Color textColor, Color borderColor)īrush textBrush = new SolidBrush(textColor) īrush borderBrush = new SolidBrush(borderColor) private void groupBox1_Paint(object sender, PaintEventArgs e)ĭrawGroupBox(box, e.Graphics, Color.Red, Color.Blue)
0 Comments
Leave a Reply. |