ComponentFactory.Krypton.Toolkit.KryptonOffice2007Renderer.RenderToolDropButtonBackground C# (CSharp) Метод

RenderToolDropButtonBackground() приватный Метод

private RenderToolDropButtonBackground ( Graphics g, ToolStripItem item, ToolStrip toolstrip ) : void
g System.Drawing.Graphics
item System.Windows.Forms.ToolStripItem
toolstrip System.Windows.Forms.ToolStrip
Результат void
        private void RenderToolDropButtonBackground(Graphics g,
                                                    ToolStripItem item,
                                                    ToolStrip toolstrip)
        {
            // We only draw a background if the item is selected or being pressed
            if (item.Selected || item.Pressed)
            {
                if (item.Enabled)
                {
                    if (item.Pressed)
                        DrawContextMenuHeader(g, item);
                    else
                    {
                        // Ensure we have cached the objects we need
                        UpdateCache();

                        DrawGradientToolItem(g, item, _gradientTracking);
                    }
                }
                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 (!item.Bounds.Contains(mousePos))
                        DrawGradientToolItem(g, item, _disabledItem);
                }
            }
        }