您的位置:首页 > 编程语言 > C#

C# 制作圆角label

2014-06-04 12:52 197 查看
private void DrawRoundRect(Label label)
{
float X = (float)(label.Width);
float Y = (float)(label.Height);
PointF[] points =
{
new PointF(2,0),
new PointF(X-2,0),
new PointF(X,2),
new PointF(X,Y-2),
new PointF(X-2,Y),
new PointF(2,Y),
new PointF(0,Y-2),
new PointF(0,2),
};
GraphicsPath path = new GraphicsPath();
path.AddLines(points);
label.Region = new Region(path);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: