Ejemplo n.º 1
0
        public static void DrawDocumentTab(Graphics g, Rectangle rect, Color backColorBegin, Color backColorEnd, Color edgeColor, TabDrawType tabType, bool closed)
        {
            GraphicsPath path = null;
            Region region = null;
            Brush brush = null;
            Pen pen = null;
            brush = new LinearGradientBrush(rect, backColorBegin, backColorEnd, LinearGradientMode.Vertical);
            pen = new Pen(edgeColor, 1.0F);
            path = new GraphicsPath();

            if (tabType == TabDrawType.First)
            {
                path.AddLine(rect.Left + 1, rect.Bottom + 1, rect.Left + rect.Height, rect.Top + 2);
                path.AddLine(rect.Left + rect.Height + 4, rect.Top, rect.Right - 3, rect.Top);
                path.AddLine(rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom + 1);
            }
            else
            {
                if (tabType == TabDrawType.Active)
                {
                    path.AddLine(rect.Left + 1, rect.Bottom + 1, rect.Left + rect.Height, rect.Top + 2);
                    path.AddLine(rect.Left + rect.Height + 4, rect.Top, rect.Right - 3, rect.Top);
                    path.AddLine(rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom + 1);
                }
                else
                {
                    path.AddLine(rect.Left, rect.Top + 6, rect.Left + 4, rect.Top + 2);
                    path.AddLine(rect.Left + 8, rect.Top, rect.Right - 3, rect.Top);
                    path.AddLine(rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom + 1);
                    path.AddLine(rect.Right - 1, rect.Bottom + 1, rect.Left, rect.Bottom + 1);
                }
            }
            region = new Region(path);
            g.FillRegion(brush, region);
            g.DrawPath(pen, path);
        }
Ejemplo n.º 2
0
        public static void DrawDocumentTab(Graphics g, Rectangle rect, Color backColorBegin, Color backColorEnd, Color edgeColor, TabDrawType tabType, bool closed)
        {
            GraphicsPath path   = default(GraphicsPath);
            Region       region = default(Region);
            Brush        brush  = null;
            Pen          pen    = default(Pen);

            brush = new LinearGradientBrush(rect, backColorBegin, backColorEnd, LinearGradientMode.Vertical);
            pen   = new Pen(edgeColor, 1f);
            path  = new GraphicsPath();

            if (tabType == TabDrawType.First)
            {
                path.AddLine(rect.Left + 1, rect.Bottom + 1, rect.Left + rect.Height, rect.Top + 2);
                path.AddLine(rect.Left + rect.Height + 4, rect.Top, rect.Right - 3, rect.Top);
                path.AddLine(rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom + 1);
            }
            else
            {
                if (tabType == TabDrawType.Active)
                {
                    path.AddLine(rect.Left + 1, rect.Bottom + 1, rect.Left + rect.Height, rect.Top + 2);
                    path.AddLine(rect.Left + rect.Height + 4, rect.Top, rect.Right - 3, rect.Top);
                    path.AddLine(rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom + 1);
                }
                else
                {
                    path.AddLine(rect.Left, rect.Top + 6, rect.Left + 4, rect.Top + 2);
                    path.AddLine(rect.Left + 8, rect.Top, rect.Right - 3, rect.Top);
                    path.AddLine(rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom + 1);
                    path.AddLine(rect.Right - 1, rect.Bottom + 1, rect.Left, rect.Bottom + 1);
                }
            }
            region = new Region(path);
            g.FillRegion(brush, region);
            g.DrawPath(pen, path);
        }