就是让Tab控件上方的按钮不是长方形的,改称vs中的样式。

解决方案 »

  1.   

    我做不到,好象很不容易的.Mark!
      

  2.   

    需要自定义控件,比如Label控件,然后建立一个梯形的路径GraphicsPath对象,假设名称为path,
    然后这样将path赋值给控件的this.Region = new Region(path);即可。并且还可以在控件的Paint事件中填充背景为渐变颜色,很不错。
      

  3.   

    给搂主贴下获取梯形GraphicsPath对象的方法吧://rect参数是用来设置梯形的大小,nRoundRadius用来设置梯形斜坡处的圆角的半径
    private GraphicsPath GetRoundTrapeziaPath(Rectangle rect, int nRoundRadius)
    {
        GraphicsPath path = new GraphicsPath();
        Point topLineLeft = new Point((rect.X + rect.Height) + nRoundRadius, rect.Y);
        Point topLineRight = new Point((rect.X + rect.Width) - nRoundRadius, rect.Y);
        Point rightLineTop = new Point(rect.X + rect.Width, rect.Y + nRoundRadius);
        Point rightLineBottom = new Point(rect.X + rect.Width, rect.Y + rect.Height);
        Point bottomLineLeft = new Point(rect.X, rect.Y + rect.Height);
        Point bottomLineRight = rightLineBottom;
        Rectangle leftTopArcRect = new Rectangle(topLineLeft.X - (nRoundRadius * 3), rect.Y, nRoundRadius * 6, nRoundRadius * 6);
        Rectangle rightTopArcRect = new Rectangle(rect.Width - (nRoundRadius * 2), rect.Y, nRoundRadius * 2, nRoundRadius * 2);
        path.AddLine(topLineLeft, topLineRight);
        path.AddArc(rightTopArcRect, 270f, 90f);
        path.AddLine(rightLineTop, rightLineBottom);
        path.AddLine(bottomLineRight, bottomLineLeft);
        path.AddArc(leftTopArcRect, 210f, 60f);
        path.CloseFigure();
        return path;
    }