Esempio n. 1
0
        private int _Radius = 50;  // 圆角弧度
        public void Round(System.Drawing.Region region)
        {
            System.Drawing.Drawing2D.GraphicsPath oPath = new System.Drawing.Drawing2D.GraphicsPath();
            int x          = 0;
            int y          = 0;
            int thisWidth  = this.Width;
            int thisHeight = this.Height;
            int angle      = _Radius;

            if (angle > 0)
            {
                System.Drawing.Graphics g = CreateGraphics();
                oPath.AddArc(x, y, angle, angle, 180, 90);                                 // 左上角
                oPath.AddArc(thisWidth - angle, y, angle, angle, 270, 90);                 // 右上角
                oPath.AddArc(thisWidth - angle, thisHeight - angle, angle, angle, 0, 90);  // 右下角
                oPath.AddArc(x, thisHeight - angle, angle, angle, 90, 90);                 // 左下角
                oPath.CloseAllFigures();
                Region = new System.Drawing.Region(oPath);
            }
            else
            {
                oPath.AddLine(x + angle, y, thisWidth - angle, y);                         // 顶端
                oPath.AddLine(thisWidth, y + angle, thisWidth, thisHeight - angle);        // 右边
                oPath.AddLine(thisWidth - angle, thisHeight, x + angle, thisHeight);       // 底边
                oPath.AddLine(x, y + angle, x, thisHeight - angle);                        // 左边
                oPath.CloseAllFigures();
                Region = new System.Drawing.Region(oPath);
            }
        }
Esempio n. 2
0
        // 圆角代码 第一个参数是该元素的宽,第二个参数是元素的高,第三个参数是圆角半径
        public Region Round(int width, int height, int _Radius)
        {
            System.Drawing.Drawing2D.GraphicsPath oPath = new System.Drawing.Drawing2D.GraphicsPath();
            int x          = 1;
            int y          = 1;
            int thisWidth  = width;
            int thisHeight = height;
            int angle      = _Radius;

            if (angle > 0)
            {
                System.Drawing.Graphics g = CreateGraphics();
                oPath.AddArc(x, y, angle, angle, 180, 90);                                // 左上角
                oPath.AddArc(thisWidth - angle, y, angle, angle, 270, 90);                // 右上角
                oPath.AddArc(thisWidth - angle, thisHeight - angle, angle, angle, 0, 90); // 右下角
                oPath.AddArc(x, thisHeight - angle, angle, angle, 90, 90);                // 左下角

                oPath.CloseAllFigures();
                return(new System.Drawing.Region(oPath));
            }
            // -----------------------------------------------------------------------------------------------
            else
            {
                oPath.AddLine(x + angle, y, thisWidth - angle, y);                   // 顶端
                oPath.AddLine(thisWidth, y + angle, thisWidth, thisHeight - angle);  // 右边
                oPath.AddLine(thisWidth - angle, thisHeight, x + angle, thisHeight); // 底边
                oPath.AddLine(x, y + angle, x, thisHeight - angle);                  // 左边
                oPath.CloseAllFigures();
                return(new System.Drawing.Region(oPath));
            }
        }
        // 圆角代码
        public void Round(System.Drawing.Region region)
        {
            // -----------------------------------------------------------------------------------------------
            // 已经是.net提供给我们的最容易的改窗体的属性了(以前要自己调API)
            System.Drawing.Drawing2D.GraphicsPath oPath = new System.Drawing.Drawing2D.GraphicsPath();
            int x          = 0;
            int y          = 0;
            int thisWidth  = this.Width;
            int thisHeight = this.Height;
            int angle      = _Radius;

            if (angle > 0)
            {
                oPath.AddEllipse(x, y, this.Width, this.Height);        // 左下角
                oPath.CloseAllFigures();
                Region = new System.Drawing.Region(oPath);
            }
            // -----------------------------------------------------------------------------------------------
            else
            {
                oPath.AddLine(x + angle, y, thisWidth - angle, y);                   // 顶端
                oPath.AddLine(thisWidth, y + angle, thisWidth, thisHeight - angle);  // 右边
                oPath.AddLine(thisWidth - angle, thisHeight, x + angle, thisHeight); // 底边
                oPath.AddLine(x, y + angle, x, thisHeight - angle);
                oPath.Flatten();                                                     // 左边
                oPath.CloseAllFigures();
                Region = new System.Drawing.Region(oPath);
            }
        }
Esempio n. 4
0
 // 圆角代码
 public void Round(System.Drawing.Region region)
 {
     // -----------------------------------------------------------------------------------------------
     // 已经是.net提供给我们的最容易的改窗体的属性了(以前要自己调API)
     System.Drawing.Drawing2D.GraphicsPath oPath = new System.Drawing.Drawing2D.GraphicsPath();
     int x = 0;
     int y = 0;
     int thisWidth = this.Width;
     int thisHeight = this.Height;
     int angle = _Radius;
     if (angle > 0)
     {
         System.Drawing.Graphics g = CreateGraphics();
         oPath.AddArc(x, y, angle, angle, 180, 90); // 左上角
         oPath.AddArc(thisWidth - angle, y, angle, angle, 270, 90); // 右上角
         oPath.AddArc(thisWidth - angle, thisHeight - angle, angle, angle, 0, 90); // 右下角
         oPath.AddArc(x, thisHeight - angle, angle, angle, 90, 90); // 左下角
         oPath.CloseAllFigures();
         Region = new System.Drawing.Region(oPath);
     }
     // -----------------------------------------------------------------------------------------------
     else
     {
         oPath.AddLine(x + angle, y, thisWidth - angle, y); // 顶端
         oPath.AddLine(thisWidth, y + angle, thisWidth, thisHeight - angle); // 右边
         oPath.AddLine(thisWidth - angle, thisHeight, x + angle, thisHeight); // 底边
         oPath.AddLine(x, y + angle, x, thisHeight - angle); // 左边
         oPath.CloseAllFigures();
         Region = new System.Drawing.Region(oPath);
     }
 }
Esempio n. 5
0
        private void DrawFilledPath(SeriesBase series, System.Drawing.Pen pen,System.Drawing.Brush brush)
        {
            var path = new System.Drawing.Drawing2D.GraphicsPath();

            if (series is AreaSeries)
            {
                path.StartFigure();
                AreaSeries areaSeries = series as AreaSeries;
                var points = areaSeries.AreaPoints;
                var pointCount = areaSeries.AreaPoints.Count;
                for (int i = 0; i < pointCount - 1; i++)
                {
                    System.Drawing.PointF startPoint = points[i].AsDrawingPointF();
                    System.Drawing.PointF endPoint = points[i + 1].AsDrawingPointF();
                    path.AddLine(startPoint, endPoint);
                }

                path.CloseAllFigures();

                switch (RenderingMode)
                {
                    case RenderingMode.GDIRendering:
                        GDIGraphics.FillPath(brush, path);
                        break;
                    case RenderingMode.Default:
                        break;
                    case RenderingMode.WritableBitmap:
                        WritableBitmapGraphics.FillPath(brush, path);
                        break;
                    default:
                        break;
                }
            }
        }
Esempio n. 6
0
        private void UpdateRegion()
        {
            System.Drawing.Drawing2D.GraphicsPath FormRegion = new System.Drawing.Drawing2D.GraphicsPath();

            FormRegion.AddRectangle(new Rectangle(0, 0, this.Width, this.Height));
            FormRegion.CloseAllFigures();

            this.Region = new System.Drawing.Region(FormRegion);
        }
Esempio n. 7
0
 public static System.Drawing.Drawing2D.GraphicsPath DrawRoundRect(int x, int y, int width, int height, int radius)
 {
     System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
     path.AddArc(x, y, radius, radius, 180f, 90f);
     path.AddArc(width - radius, y, radius, radius, 270f, 90f);
     path.AddArc(width - radius, height - radius, radius, radius, 0f, 90f);
     path.AddArc(x, height - radius, radius, radius, 90f, 90f);
     path.CloseAllFigures();
     return(path);
 }
Esempio n. 8
0
 public static System.Drawing.Drawing2D.GraphicsPath DrawRoundRect(int x, int y, int width, int height, int radius)
 {
     System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
     path.AddArc(x, y, radius, radius, 180f, 90f);
     path.AddArc(width - radius, y, radius, radius, 270f, 90f);
     path.AddArc(width - radius, height - radius, radius, radius, 0f, 90f);
     path.AddArc(x, height - radius, radius, radius, 90f, 90f);
     path.CloseAllFigures();
     return path;
 }
        private void UpdateRegion()
        {
            FindDiameter();

            System.Drawing.Drawing2D.GraphicsPath FormRegion = new System.Drawing.Drawing2D.GraphicsPath();

            FormRegion.AddEllipse(0, 0, Diameter, Diameter);
            FormRegion.CloseAllFigures();

            this.Region = new System.Drawing.Region(FormRegion);
        }
        public static void RoundBorderPanel(Panel frm)
        {
            Rectangle Bounds       = new Rectangle(0, 0, frm.Width, frm.Height);
            int       CornerRadius = 20;

            System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            path.AddArc(Bounds.X, Bounds.Y, CornerRadius, CornerRadius, 180, 90);
            path.AddArc(Bounds.X + Bounds.Width - CornerRadius, Bounds.Y, CornerRadius, CornerRadius, 270, 90);
            path.AddArc(Bounds.X + Bounds.Width - CornerRadius, Bounds.Y + Bounds.Height - CornerRadius, CornerRadius, CornerRadius, 0, 90);
            path.AddArc(Bounds.X, Bounds.Y + Bounds.Height - CornerRadius, CornerRadius, CornerRadius, 90, 90);
            path.CloseAllFigures();
            frm.Region = new Region(path);
            frm.Show();
        }
Esempio n. 11
0
        private void UpdateRegion()
        {
            System.Drawing.Drawing2D.GraphicsPath FormRegion = new System.Drawing.Drawing2D.GraphicsPath();

            //rounded corners
            FormRegion.AddArc(0, 0, Diameter, Diameter, 180, 90);                                          //top left
            FormRegion.AddLine(Radius, 0, this.Width - Radius, 0);                                         //top
            FormRegion.AddArc(this.Width - Diameter, 0, Diameter, Diameter, -90, 90);                      //top right
            FormRegion.AddLine(this.Width, Radius, this.Width, this.Height - Radius);                      //right
            FormRegion.AddArc(this.Width - Diameter, this.Height - Diameter, Diameter, Diameter, 360, 90); //bottom right
            FormRegion.AddLine(Radius, this.Height, this.Width - Radius, this.Height);                     //bottom
            FormRegion.AddArc(0, this.Height - Diameter, Diameter, Diameter, 90, 90);                      //bottom left
            FormRegion.AddLine(0, Radius, 0, this.Height - Radius);                                        //left

            FormRegion.CloseAllFigures();

            this.Region = new System.Drawing.Region(FormRegion);
        }
        public static void DrawFrame(System.Drawing.Graphics dc, System.Drawing.RectangleF r, float cornerRadius, System.Drawing.Color color)
        {
            var pen = new System.Drawing.Pen(color);
            if (cornerRadius <= 0)
            {
                dc.DrawRectangle(pen, ColorPickerUtil.Rect(r));
                return;
            }
            cornerRadius = (float)System.Math.Min(cornerRadius, System.Math.Floor(r.Width) - 2);
            cornerRadius = (float)System.Math.Min(cornerRadius, System.Math.Floor(r.Height) - 2);

            var path = new System.Drawing.Drawing2D.GraphicsPath();
            path.AddArc(r.X, r.Y, cornerRadius, cornerRadius, 180, 90);
            path.AddArc(r.Right - cornerRadius, r.Y, cornerRadius, cornerRadius, 270, 90);
            path.AddArc(r.Right - cornerRadius, r.Bottom - cornerRadius, cornerRadius, cornerRadius, 0, 90);
            path.AddArc(r.X, r.Bottom - cornerRadius, cornerRadius, cornerRadius, 90, 90);
            path.CloseAllFigures();
            dc.DrawPath(pen, path);
        }
Esempio n. 13
0
        private void cmdShowToast_Click(object sender, EventArgs e)
        {
            t = new Toast();

            Rectangle Bounds       = new Rectangle(0, 0, t.Width, t.Height);
            int       CornerRadius = 20;

            System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            path.AddArc(Bounds.X, Bounds.Y, CornerRadius, CornerRadius, 180, 90);
            path.AddArc(Bounds.X + Bounds.Width - CornerRadius, Bounds.Y, CornerRadius, CornerRadius, 270, 90);
            path.AddArc(Bounds.X + Bounds.Width - CornerRadius, Bounds.Y + Bounds.Height - CornerRadius, CornerRadius, CornerRadius, 0, 90);
            path.AddArc(Bounds.X, Bounds.Y + Bounds.Height - CornerRadius, CornerRadius, CornerRadius, 90, 90);
            path.CloseAllFigures();

            t.Region = new Region(path);

            t.Show();
            t.fadeIn();
            cmdHideToast.Enabled = true;
        }
Esempio n. 14
0
        public static void DrawFrame(System.Drawing.Graphics dc, System.Drawing.RectangleF r, float cornerRadius, System.Drawing.Color color)
        {
            var pen = new System.Drawing.Pen(color);

            if (cornerRadius <= 0)
            {
                dc.DrawRectangle(pen, Rect(r));
                return;
            }
            cornerRadius = (float)System.Math.Min(cornerRadius, System.Math.Floor(r.Width) - 2);
            cornerRadius = (float)System.Math.Min(cornerRadius, System.Math.Floor(r.Height) - 2);

            var path = new System.Drawing.Drawing2D.GraphicsPath();

            path.AddArc(r.X, r.Y, cornerRadius, cornerRadius, 180, 90);
            path.AddArc(r.Right - cornerRadius, r.Y, cornerRadius, cornerRadius, 270, 90);
            path.AddArc(r.Right - cornerRadius, r.Bottom - cornerRadius, cornerRadius, cornerRadius, 0, 90);
            path.AddArc(r.X, r.Bottom - cornerRadius, cornerRadius, cornerRadius, 90, 90);
            path.CloseAllFigures();
            dc.DrawPath(pen, path);
        }
        private void DrawFilledPath(SeriesBase series, System.Drawing.Pen pen, System.Drawing.Brush brush)
        {
            var path = new System.Drawing.Drawing2D.GraphicsPath();

            if (series is AreaSeries)
            {
                path.StartFigure();
                AreaSeries areaSeries = series as AreaSeries;
                var        points     = areaSeries.AreaPoints;
                var        pointCount = areaSeries.AreaPoints.Count;
                for (int i = 0; i < pointCount - 1; i++)
                {
                    System.Drawing.PointF startPoint = points[i].AsDrawingPointF();
                    System.Drawing.PointF endPoint   = points[i + 1].AsDrawingPointF();
                    path.AddLine(startPoint, endPoint);
                }

                path.CloseAllFigures();

                switch (RenderingMode)
                {
                case RenderingMode.GDIRendering:
                    GDIGraphics.FillPath(brush, path);
                    break;

                case RenderingMode.Default:
                    break;

                case RenderingMode.WritableBitmap:
                    WritableBitmapGraphics.FillPath(brush, path);
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 16
0
        private void UpdateBackstageTabMetroRegion()
        {
            int captionHeight = 28;
            RibbonStrip strip = RibbonStrip;
            if (strip != null) captionHeight = strip.GetTotalCaptionHeight();

            _BackstageTab.Controls[SysBackstagePanelName].Height = captionHeight;

            Rectangle tabBounds = _BackstageTab.ClientRectangle;
            System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            path.AddLine(0, 0, _BackstageTab.TabStrip.Width, 0);
            path.AddLine(_BackstageTab.TabStrip.Width, 0, _BackstageTab.TabStrip.Width, captionHeight);
            path.AddLine(_BackstageTab.TabStrip.Width, captionHeight, tabBounds.Width, captionHeight);
            path.AddLine(tabBounds.Width, tabBounds.Height, 0, tabBounds.Height);
            path.CloseAllFigures();
            Region reg = new Region(path);
            _BackstageTab.Region = reg;
            path.Dispose();
        }
Esempio n. 17
0
        private void PaintOffice2003(ItemPaintArgs pa)
        {
            // When on popup the Customize Item is painted same as in .NET style...
            if (BaseItem.IsOnPopup(this))
            {
                PaintDotNet(pa);
                return;
            }

            Graphics g = pa.Graphics;
            Rectangle r = m_Rect;

            System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            if (this.Orientation == eOrientation.Vertical)
            {
                // When on docked toolbar it has a special look...
                r.Y += 2;
                r.Height -= 1;
                r.X -= 2;
                r.Width += 2;

                if (pa.RightToLeft)
                {
                    path.AddLine(r.Right, r.Y, r.Right - 2, r.Y + 2);
                    path.AddLine(r.X + 2, r.Y + 2, r.X, r.Y);
                    path.AddLine(r.X, r.Bottom - 2, r.X + 2, r.Bottom);
                    path.AddLine(r.Right - 2, r.Bottom, r.Right, r.Bottom - 2);
                }
                else
                {
                    path.AddLine(r.X, r.Y, r.X + 2, r.Y + 2);
                    path.AddLine(r.Right - 2, r.Y + 2, r.Right, r.Y);
                    path.AddLine(r.Right, r.Bottom - 2, r.Right - 2, r.Bottom);
                    path.AddLine(r.X + 2, r.Bottom, r.X, r.Bottom - 2);
                }
                path.CloseAllFigures();
            }
            else
            {
                // When on docked toolbar it has a special look...
                r.X += 2;
                r.Width -= 1;
                r.Y -= 2;
                r.Height += 3;

                if (pa.RightToLeft)
                {
                    r.X -= 2;
                    path.AddLine(r.Right, r.Y, r.Right - 2, r.Y + 2);
                    path.AddLine(r.Right - 2, r.Bottom - 2, r.Right, r.Bottom);
                    path.AddLine(r.X + 2, r.Bottom, r.X, r.Bottom - 2);
                    path.AddLine(r.X, r.Y + 2, r.X + 2, r.Y);
                }
                else
                {
                    path.AddLine(r.X, r.Y, r.X + 2, r.Y + 2);
                    path.AddLine(r.X + 2, r.Bottom - 2, r.X, r.Bottom);
                    path.AddLine(r.Right - 2, r.Bottom, r.Right, r.Bottom - 2);
                    path.AddLine(r.Right, r.Y + 2, r.Right - 2, r.Y);
                }
                path.CloseAllFigures();
            }

            System.Drawing.Drawing2D.SmoothingMode smooth = g.SmoothingMode;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            if (this.Expanded)
                DisplayHelp.FillPath(g, path, pa.Colors.ItemPressedBackground, pa.Colors.ItemPressedBackground2, pa.Colors.ItemPressedBackgroundGradientAngle);
            else if (m_MouseOver)
                DisplayHelp.FillPath(g, path, pa.Colors.ItemHotBackground, pa.Colors.ItemHotBackground2, pa.Colors.ItemHotBackgroundGradientAngle);
            else
                DisplayHelp.FillPath(g, path, pa.Colors.CustomizeBackground, pa.Colors.CustomizeBackground2, pa.Colors.CustomizeBackgroundGradientAngle);

            g.SmoothingMode = smooth;

            //using(Pen pen=new Pen(SystemColors.Window,1))
            //    g.DrawLine(pen,r.Left+(m_Rect.Width-4)/2+1,r.Bottom-11+1,r.Left+(m_Rect.Width-4)/2+4+1,r.Bottom-11+1);

            if (this.Orientation == eOrientation.Vertical)
            {
                // Draw Arrow Shade
                Point[] p = new Point[3];
                p[0].X = r.Left + (m_Rect.Width - 4) / 2 + 2 + 1;
                p[0].Y = r.Bottom - 3 + 1;
                p[1].X = p[0].X - 2;
                p[1].Y = p[0].Y - 3;
                p[2].X = p[1].X + 5;
                p[2].Y = p[1].Y;
                using (SolidBrush brush = new SolidBrush(SystemColors.Window)) // SystemColors.HighlightText))
                    g.FillPolygon(brush, p);

                // Draw Arrow
                using (Pen pen = new Pen(pa.Colors.CustomizeText, 1))
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2, r.Bottom - 9, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Bottom - 9);
                p = new Point[3];
                p[0].X = r.Left + (m_Rect.Width - 4) / 2 + 2;
                p[0].Y = r.Bottom - 3;
                p[1].X = p[0].X - 2;
                p[1].Y = p[0].Y - 3;
                p[2].X = p[1].X + 5;
                p[2].Y = p[1].Y;
                using (SolidBrush brush = new SolidBrush(pa.Colors.CustomizeText))
                    g.FillPolygon(brush, p);
            }
            else
            {
                // Draw Arrow Shade
                Point[] p = new Point[3];
                p[0].X = r.Left + (m_Rect.Width - 4) / 2 + 2 + 1;
                p[0].Y = r.Bottom - 5 + 1;
                p[1].X = p[0].X - 2;
                p[1].Y = p[0].Y - 3;
                p[2].X = p[1].X + 5;
                p[2].Y = p[1].Y;
                using (SolidBrush brush = new SolidBrush(SystemColors.Window)) // SystemColors.HighlightText))
                    g.FillPolygon(brush, p);

                // Draw Arrow
                using (Pen pen = new Pen(pa.Colors.CustomizeText, 1))
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2, r.Bottom - 11, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Bottom - 11);
                p = new Point[3];
                p[0].X = r.Left + (m_Rect.Width - 4) / 2 + 2;
                p[0].Y = r.Bottom - 5;
                p[1].X = p[0].X - 2;
                p[1].Y = p[0].Y - 3;
                p[2].X = p[1].X + 5;
                p[2].Y = p[1].Y;
                using (SolidBrush brush = new SolidBrush(pa.Colors.CustomizeText))
                    g.FillPolygon(brush, p);
            }
        }
Esempio n. 18
0
		private void PaintOffice2003(ItemPaintArgs pa)
		{
			Graphics g=pa.Graphics;

			// When on docked toolbar it has a special look...
			Rectangle r=m_Rect;

            System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
            if (this.Orientation == eOrientation.Vertical)
            {
                // When on docked toolbar it has a special look...
                r.Y += 2;
                r.Height -= 1;
                r.X -= 2;
                r.Width += 2;

                path.AddLine(r.X, r.Y, r.X + 2, r.Y + 2);
                path.AddLine(r.Right - 2, r.Y + 2, r.Right, r.Y);
                path.AddLine(r.Right, r.Bottom - 2, r.Right - 2, r.Bottom);
                path.AddLine(r.X + 2, r.Bottom, r.X, r.Bottom - 2);
                path.CloseAllFigures();
            }
            else
            {
                // When on docked toolbar it has a special look...
                r.X += 2;
                r.Width -= 1;
                r.Y -= 2;
                r.Height += 3;

                path.AddLine(r.X, r.Y, r.X + 2, r.Y + 2);
                path.AddLine(r.X + 2, r.Bottom - 2, r.X, r.Bottom);
                path.AddLine(r.Right - 2, r.Bottom, r.Right, r.Bottom - 2);
                path.AddLine(r.Right, r.Y + 2, r.Right - 2, r.Y);
                path.CloseAllFigures();
            }

			System.Drawing.Drawing2D.SmoothingMode smooth=g.SmoothingMode;
			g.SmoothingMode=System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
			if(this.Expanded)
			{
				System.Drawing.Drawing2D.LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(r,pa.Colors.ItemPressedBackground,pa.Colors.ItemPressedBackground2,pa.Colors.ItemPressedBackgroundGradientAngle);
				g.FillPath(gradient,path);
				gradient.Dispose();
			}
			else if(m_MouseOver)
			{
				System.Drawing.Drawing2D.LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(r,pa.Colors.ItemHotBackground,pa.Colors.ItemHotBackground2,pa.Colors.ItemHotBackgroundGradientAngle);
				g.FillPath(gradient,path);
				gradient.Dispose();
			}
			else
			{
				System.Drawing.Drawing2D.LinearGradientBrush gradient=BarFunctions.CreateLinearGradientBrush(r,pa.Colors.CustomizeBackground,pa.Colors.CustomizeBackground2,pa.Colors.CustomizeBackgroundGradientAngle);
				g.FillPath(gradient,path);
				gradient.Dispose();
			}
			g.SmoothingMode=smooth;

            if (this.Orientation == eOrientation.Vertical)
            {
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2, r.Bottom - 10 + 1, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Bottom - 10 + 1);

                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 - 1 + 1, r.Top + 6 + 1, r.Left + (m_Rect.Width - 4) / 2 - 1 + 1, r.Top + 8 + 1);
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 + 3 + 1, r.Top + 6 + 1, r.Left + (m_Rect.Width - 4) / 2 + 3 + 1, r.Top + 8 + 1);
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 - 1 + 1, r.Top + 7 + 1, r.Left + (m_Rect.Width - 4) / 2 + 1, r.Top + 7 + 1);
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 + 3 + 1, r.Top + 7 + 1, r.Left + (m_Rect.Width - 4) / 2 + 4 + 1, r.Top + 7 + 1);

                // Draw Arrow
                using (Pen pen = new Pen(pa.Colors.CustomizeText, 1))
                {
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2, r.Bottom - 10, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Bottom - 10);

                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 - 1, r.Top + 6, r.Left + (m_Rect.Width - 4) / 2 - 1, r.Top + 8);
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 + 3, r.Top + 6, r.Left + (m_Rect.Width - 4) / 2 + 3, r.Top + 8);
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 - 1, r.Top + 7, r.Left + (m_Rect.Width - 4) / 2, r.Top + 7);
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 + 3, r.Top + 7, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Top + 7);
                }
            }
            else
            {
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 + 1, r.Bottom - 11 + 1, r.Left + (m_Rect.Width - 4) / 2 + 4 + 1, r.Bottom - 11 + 1);

                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 - 1 + 1, r.Top + 6 + 1, r.Left + (m_Rect.Width - 4) / 2 - 1 + 1, r.Top + 8 + 1);
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 + 3 + 1, r.Top + 6 + 1, r.Left + (m_Rect.Width - 4) / 2 + 3 + 1, r.Top + 8 + 1);
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 - 1 + 1, r.Top + 7 + 1, r.Left + (m_Rect.Width - 4) / 2 + 1, r.Top + 7 + 1);
                g.DrawLine(SystemPens.HighlightText, r.Left + (m_Rect.Width - 4) / 2 + 3 + 1, r.Top + 7 + 1, r.Left + (m_Rect.Width - 4) / 2 + 4 + 1, r.Top + 7 + 1);

                // Draw Arrow Shade
                Point[] p = new Point[3];
                p[0].X = r.Left + (m_Rect.Width - 4) / 2 + 2 + 1;
                p[0].Y = r.Bottom - 5 + 1;
                p[1].X = p[0].X - 2;
                p[1].Y = p[0].Y - 3;
                p[2].X = p[1].X + 5;
                p[2].Y = p[1].Y;
                using (SolidBrush brush = new SolidBrush(SystemColors.HighlightText))
                    g.FillPolygon(brush, p);

                // Draw Arrow
                using (Pen pen = new Pen(pa.Colors.CustomizeText, 1))
                {
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2, r.Bottom - 11, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Bottom - 11);

                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 - 1, r.Top + 6, r.Left + (m_Rect.Width - 4) / 2 - 1, r.Top + 8);
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 + 3, r.Top + 6, r.Left + (m_Rect.Width - 4) / 2 + 3, r.Top + 8);
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 - 1, r.Top + 7, r.Left + (m_Rect.Width - 4) / 2, r.Top + 7);
                    g.DrawLine(pen, r.Left + (m_Rect.Width - 4) / 2 + 3, r.Top + 7, r.Left + (m_Rect.Width - 4) / 2 + 4, r.Top + 7);
                }
                p = new Point[3];
                p[0].X = r.Left + (m_Rect.Width - 4) / 2 + 2;
                p[0].Y = r.Bottom - 5;
                p[1].X = p[0].X - 2;
                p[1].Y = p[0].Y - 3;
                p[2].X = p[1].X + 5;
                p[2].Y = p[1].Y;
                using (SolidBrush brush = new SolidBrush(pa.Colors.CustomizeText))
                    g.FillPolygon(brush, p);
            }
		}