ComponentFactory.Krypton.Toolkit.KryptonOffice2013Renderer.RenderToolSplitButtonBackground C# (CSharp) Method

RenderToolSplitButtonBackground() private method

private RenderToolSplitButtonBackground ( Graphics g, ToolStripSplitButton splitButton, ToolStrip toolstrip ) : void
g System.Drawing.Graphics
splitButton System.Windows.Forms.ToolStripSplitButton
toolstrip System.Windows.Forms.ToolStrip
return void
        private void RenderToolSplitButtonBackground(Graphics g,
                                                     ToolStripSplitButton splitButton,
                                                     ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (splitButton.Selected || splitButton.Pressed)
            {
                if (splitButton.Enabled)
                {
                    // Ensure we have cached the objects we need
                    UpdateCache();

                    if (!splitButton.Pressed && splitButton.ButtonPressed)
                        DrawGradientToolSplitItem(g, splitButton, _gradientPressed, _gradientTracking, _gradientSplit);
                    else if (splitButton.Pressed && !splitButton.ButtonPressed)
                        DrawContextMenuHeader(g, splitButton);
                    else
                        DrawGradientToolSplitItem(g, splitButton, _gradientTracking, _gradientTracking, _gradientSplit);
                }
                else
                {
                    // Get the mouse position in tool strip coordinates
                    Point mousePos = toolstrip.PointToClient(Control.MousePosition);

                    // If the mouse is not in the item area, then draw disabled
                    if (!splitButton.Bounds.Contains(mousePos))
                        DrawGradientToolItem(g, splitButton, _disabledItem);
                }
            }
        }