众所周知,标签通常呈方形或矩形.我真的需要制作圆形标签.任何人都可以告诉我这是可能的,或者至少指出我正确的方向?
对不起,只是为了说清楚.我想要一个圆形标签.不只是在屏幕上画一个圆圈.
mat*_*ieu 12
您可以设置Label的Region属性:
var path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddEllipse(0, 0, label1.Width, label1.Height);
this.label1.Region = new Region(path);
Run Code Online (Sandbox Code Playgroud)
System.Drawing.Graphics graphics = this.CreateGraphics();
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(100, 100, 200, 200);
graphics.DrawEllipse(System.Drawing.Pens.Black, rectangle);
Run Code Online (Sandbox Code Playgroud)