points[7].X = rc.Left + 1;
points[7].Y = rc.Top + size.Height / 2;
// приготовим кисть для фона
Brush fillBrush = new SolidBrush(backColor);
// рисуем отрезки и круги для округленного прямоугольника
g.DrawLine(p, rc.Left + size.Width / 2, rc.Top,
rc.Right - size.Width / 2, rc.Top);
g.FillEllipse(fillBrush, rc.Right - size.Width, rc.Top,
size.Width, size.Height);
g.DrawEllipse(p, rc.Right - size.Width, rc.Top, size.Width, size.Height);
g.DrawLine(p, rc.Right, rc.Top + size.Height / 2, rc.Right,
rc.Bottom - size.Height /2);
g.FillEllipse(fillBrush, rc.Right - size.Width, rc.Bottom - size.Height,
size.Width, size.Height);
g.DrawEllipse(p, rc.Right - size.Width, rc.Bottom - size.Height,
size.Width, size.Height);
g.DrawLine(p, rc.Right - size.Width / 2, rc.Bottom,
rc.Left + size.Width / 2, rc.Bottom);
g.FillEllipse(fillBrush, rc.Left, rc.Bottom - size.Height,
size.Width, size.Height);
g.DrawEllipse(p, rc.Left, rc.Bottom - size.Height,
size.Width, size.Height);
g.DrawLine(p, rc.Left, rc.Bottom - size.Height / 2,
rc.Left, rc.Top + size.Height / 2);
g.FillEllipse(fillBrush. rc.Left, rc.Top, size.Width, size.Height);
g.DrawEllipse(p, rc.Left, rc.Top, size.Width. size.Height);
// заполняем прямоугольник, скрывая внутренние эллипсы
g.FillPolygon(fillBrush, points);
// освобождаем ресурсы
fillBrush.Dispose();