protected override void OnRenderImageMargin(ToolStripRenderEventArgs e)
{
if ((e.ToolStrip is ContextMenuStrip) ||
(e.ToolStrip is ToolStripDropDownMenu))
{
// Start with the total margin area
Rectangle marginRect = e.AffectedBounds;
// Do we need to draw with separator on the opposite edge?
bool rtl = (e.ToolStrip.RightToLeft == RightToLeft.Yes);
marginRect.Y += _marginInset;
marginRect.Height -= _marginInset * 2;
// Reduce so it is inside the border
if (!rtl)
marginRect.X += _marginInset;
else
marginRect.X += _marginInset / 2;
using (Pen marginPen = new Pen(Color.FromArgb(80, KCT.MenuBorder)))
{
if (!rtl)
e.Graphics.DrawLine(marginPen, marginRect.Right, marginRect.Top, marginRect.Right, marginRect.Bottom);
else
e.Graphics.DrawLine(marginPen, marginRect.Left - 1, marginRect.Top, marginRect.Left - 1, marginRect.Bottom);
}
}
else
{
base.OnRenderImageMargin(e);
}
}