ComponentFactory.Krypton.Toolkit.KryptonSparkleRenderer.OnRenderSplitButtonBackground C# (CSharp) Method

OnRenderSplitButtonBackground() protected method

Raises the RenderSplitButtonBackground event.
protected OnRenderSplitButtonBackground ( System.Windows.Forms.ToolStripItemRenderEventArgs e ) : void
e System.Windows.Forms.ToolStripItemRenderEventArgs An ToolStripItemRenderEventArgs containing the event data.
return void
        protected override void OnRenderSplitButtonBackground(ToolStripItemRenderEventArgs e)
        {
            if (e.Item.Selected || e.Item.Pressed)
            {
                // Cast to correct type
                ToolStripSplitButton splitButton = (ToolStripSplitButton)e.Item;

                // Draw the border and background
                RenderToolSplitButtonBackground(e.Graphics, splitButton, e.ToolStrip);

                // Get the rectangle that needs to show the arrow
                Rectangle arrowBounds = splitButton.DropDownButtonBounds;

                // Draw the arrow on top of the background
                OnRenderArrow(new ToolStripArrowRenderEventArgs(e.Graphics,
                                                                splitButton,
                                                                arrowBounds,
                                                                SystemColors.ControlText,
                                                                ArrowDirection.Down));
            }
            else
            {
                base.OnRenderSplitButtonBackground(e);
            }
        }