private void ListBoxDrawTest(ListBox lb, int len)
{
Graphics g=lb.CreateGraphics();
Rectangle rect=lb.ClientRectangle;
GraphicsPath path = new GraphicsPath();
path.AddArc(rect.Left, rect.Top, 2 * len, 2 * len, 180, 90);
path.AddLine(rect.Left + len, rect.Top, rect.Right - len, rect.Top);
path.AddArc(rect.Right - 2 * len, rect.Top, 2 * len, 2 * len, 270, 90);
path.AddLine(rect.Right, rect.Top + len, rect.Right, rect.Bottom - len);
path.AddArc(rect.Right - 2 * len, rect.Bottom - 2 * len, 2 * len, 2 * len, 0, 90);
path.AddLine(rect.Left + len, rect.Bottom, rect.Right - len, rect.Bottom);
path.AddArc(rect.Left, rect.Bottom - 2 * len, 2 * len, 2 * len, 90, 90);
path.AddLine(rect.Left, rect.Top + len, rect.Left, rect.Bottom - len);
lb.Region = new Region(path);
//g.DrawPath(Pens.Black, path);
}
{
Graphics g=lb.CreateGraphics();
Rectangle rect=lb.ClientRectangle;
GraphicsPath path = new GraphicsPath();
path.AddArc(rect.Left, rect.Top, 2 * len, 2 * len, 180, 90);
path.AddLine(rect.Left + len, rect.Top, rect.Right - len, rect.Top);
path.AddArc(rect.Right - 2 * len, rect.Top, 2 * len, 2 * len, 270, 90);
path.AddLine(rect.Right, rect.Top + len, rect.Right, rect.Bottom - len);
path.AddArc(rect.Right - 2 * len, rect.Bottom - 2 * len, 2 * len, 2 * len, 0, 90);
path.AddLine(rect.Left + len, rect.Bottom, rect.Right - len, rect.Bottom);
path.AddArc(rect.Left, rect.Bottom - 2 * len, 2 * len, 2 * len, 90, 90);
path.AddLine(rect.Left, rect.Top + len, rect.Left, rect.Bottom - len);
lb.Region = new Region(path);
//g.DrawPath(Pens.Black, path);
}