public virtual void Paint()
{
Pad.Graphics.FillRectangle(new SolidBrush(BackColor), X, Y, Width, Height);
if (BorderEnabled)
Pad.Graphics.DrawRectangle(new Pen(BorderColor), X, Y, Width, Height);
var x = X + 5;
var y = Y + 2;
foreach (TLegendItem item in Items)
{
var h = (int)Pad.Graphics.MeasureString(item.Text, item.Font).Height;
Pad.Graphics.DrawLine(new Pen(item.Color), x, y + h / 2, x + 5, y + h / 2);
Pad.Graphics.DrawString(item.Text, item.Font, new SolidBrush(Color.Black), x + 5 + 2, y);
y += 2 + h;
}
}
}