ComponentFactory.Krypton.Toolkit.KryptonOffice2010Renderer.OnRenderImageMargin C# (CSharp) Метод

OnRenderImageMargin() защищенный Метод

Raises the RenderImageMargin event.
protected OnRenderImageMargin ( System.Windows.Forms.ToolStripRenderEventArgs e ) : void
e System.Windows.Forms.ToolStripRenderEventArgs An ToolStripRenderEventArgs containing the event data.
Результат void
        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);
            }
        }