whisht

    十年

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
private void FrmMain_Paint(object sender, PaintEventArgs e)
{           
    GraphicsPath oPath = new GraphicsPath();

    int x = 0;
    int y = 0;
    int w = Width;
    int h = Height;
    int a = 8;
    Graphics g = CreateGraphics();
    oPath.AddArc(x, y, a, a, 180, 90); //边框格式
    oPath.AddArc(w - a, y, a, a, 270, 90);
    oPath.AddArc(w - a / 2, h - a / 2, a / 2, a / 2, 0, 90);
    oPath.AddArc(x, h - a, a, a, 90, 90);
    oPath.CloseAllFigures();
    Region = new Region(oPath);
}

posted on 2013-03-01 10:36  WHISHT  阅读(1279)  评论(0编辑  收藏  举报