/// <summary>
        /// Draws the background of a menu, vista style
        /// </summary>
        /// <param name="g"></param>
        /// <param name="r"></param>
        /// <param name="highlighted"></param>
        private void DrawVistaMenuBackground(Graphics g, Rectangle r, bool highlighted, bool isMainMenu)
        {
            //g.Clear(ColorTable.MenuBackground);

            int margin = 2;
            int left   = 22;

            #region IconSeparator

            if (!isMainMenu)
            {
                using (Pen p = new Pen(ColorTable.MenuDark)) {
                    g.DrawLine(p,
                               new Point(r.Left + left, r.Top),
                               new Point(r.Left + left, r.Height - margin));
                }


                using (Pen p = new Pen(ColorTable.MenuLight)) {
                    g.DrawLine(p,
                               new Point(r.Left + left + 1, r.Top),
                               new Point(r.Left + left + 1, r.Height - margin));
                }
            }

            #endregion

            if (highlighted)
            {
                #region Draw Rectangle

                using (GraphicsPath path = GraphicsTools.CreateRoundRectangle(
                           new Rectangle(r.X + margin, r.Y + margin, r.Width - margin * 2, r.Height - margin * 2), 3)) {
                    using (Brush b = new LinearGradientBrush(
                               new Point(0, 2), new Point(0, r.Height - 2),
                               ColorTable.MenuHighlightNorth,
                               ColorTable.MenuHighlightSouth)) {
                        g.FillPath(b, path);
                    }

                    using (Pen p = new Pen(ColorTable.MenuHighlight)) {
                        g.DrawPath(p, path);
                    }
                }

                #endregion
            }
        }
        /// <summary>
        /// Renders the background of a button on the specified rectangle using the specified device
        /// </summary>
        /// <param name="e"></param>
        private void DrawVistaButtonBackground(Graphics g, Rectangle r, bool selected, bool pressed, bool checkd)
        {
            g.SmoothingMode = SmoothingMode.AntiAlias;

            Rectangle outerBorder = new Rectangle(r.Left, r.Top, r.Width - 1, r.Height - 1);
            Rectangle border      = outerBorder; border.Inflate(-1, -1);
            Rectangle innerBorder = border; innerBorder.Inflate(-1, -1);
            Rectangle glossy      = outerBorder; glossy.Height /= 2;
            Rectangle fill        = innerBorder; fill.Height /= 2;
            Rectangle glow        = Rectangle.FromLTRB(outerBorder.Left,
                                                       outerBorder.Top + Convert.ToInt32(Convert.ToSingle(outerBorder.Height) * .5f),
                                                       outerBorder.Right, outerBorder.Bottom);

            if (selected || pressed || checkd)
            {
                #region Layers

                //Outer border
                using (GraphicsPath path =
                           GraphicsTools.CreateRoundRectangle(outerBorder, ButtonRadius)) {
                    using (Pen p = new Pen(ColorTable.ButtonOuterBorder)) {
                        g.DrawPath(p, path);
                    }
                }

                //Checked fill
                if (checkd)
                {
                    using (GraphicsPath path = GraphicsTools.CreateRoundRectangle(innerBorder, 2)) {
                        using (Brush b = new SolidBrush(selected ? ColorTable.CheckedButtonFillHot : ColorTable.CheckedButtonFill)) {
                            g.FillPath(b, path);
                        }
                    }
                }

                //Glossy effefct
                using (GraphicsPath path = GraphicsTools.CreateTopRoundRectangle(glossy, ButtonRadius)) {
                    using (Brush b = new LinearGradientBrush(
                               new Point(0, glossy.Top),
                               new Point(0, glossy.Bottom),
                               ColorTable.GlossyEffectNorth,
                               ColorTable.GlossyEffectSouth)) {
                        g.FillPath(b, path);
                    }
                }

                //Border
                using (GraphicsPath path =
                           GraphicsTools.CreateRoundRectangle(border, ButtonRadius)) {
                    using (Pen p = new Pen(ColorTable.ButtonBorder)) {
                        g.DrawPath(p, path);
                    }
                }

                Color fillNorth = pressed ? ColorTable.ButtonFillNorthPressed : ColorTable.ButtonFillNorth;
                Color fillSouth = pressed ? ColorTable.ButtonFillSouthPressed : ColorTable.ButtonFillSouth;

                //Fill
                using (GraphicsPath path = GraphicsTools.CreateTopRoundRectangle(fill, ButtonRadius)) {
                    using (Brush b = new LinearGradientBrush(
                               new Point(0, fill.Top),
                               new Point(0, fill.Bottom),
                               fillNorth, fillSouth)) {
                        g.FillPath(b, path);
                    }
                }

                Color innerBorderColor = pressed || checkd ? ColorTable.ButtonInnerBorderPressed : ColorTable.ButtonInnerBorder;

                //Inner border
                using (GraphicsPath path =
                           GraphicsTools.CreateRoundRectangle(innerBorder, ButtonRadius)) {
                    using (Pen p = new Pen(innerBorderColor)) {
                        g.DrawPath(p, path);
                    }
                }

                //Glow
                using (GraphicsPath clip = GraphicsTools.CreateRoundRectangle(glow, 2)) {
                    g.SetClip(clip, CombineMode.Intersect);

                    Color glowColor = ColorTable.Glow;

                    if (checkd)
                    {
                        if (selected)
                        {
                            glowColor = ColorTable.CheckedGlowHot;
                        }
                        else
                        {
                            glowColor = ColorTable.CheckedGlow;
                        }
                    }

                    using (GraphicsPath brad = CreateBottomRadialPath(glow)) {
                        using (PathGradientBrush pgr = new PathGradientBrush(brad)) {
                            unchecked {
                                int        opacity = 255;
                                RectangleF bounds  = brad.GetBounds();
                                pgr.CenterPoint    = new PointF((bounds.Left + bounds.Right) / 2f, (bounds.Top + bounds.Bottom) / 2f);
                                pgr.CenterColor    = Color.FromArgb(opacity, glowColor);
                                pgr.SurroundColors = new Color[] { Color.FromArgb(0, glowColor) };
                            }
                            g.FillPath(pgr, brad);
                        }
                    }
                    g.ResetClip();
                }



                #endregion
            }
        }
 /// <summary>
 /// Gets a rounded rectangle representing the hole area of the toolstrip
 /// </summary>
 /// <param name="toolStrip"></param>
 /// <returns></returns>
 private GraphicsPath GetToolStripRectangle(ToolStrip toolStrip)
 {
     return(GraphicsTools.CreateRoundRectangle(
                new Rectangle(0, 0, toolStrip.Width - 1, toolStrip.Height - 1), ToolStripRadius));
 }