private void BeautiLoginForm_Paint(object sender, PaintEventArgs e)
{
Type(this, 25, 0.1);
}
private void Type(Control sender, int p_1, double p_2)
{
GraphicsPath oPath = new GraphicsPath();
oPath.AddClosedCurve(new Point[] {
new Point(0, sender.Height / p_1),
new Point(sender.Width / p_1, 0),
new Point(sender.Width - sender.Width / p_1, 0),
new Point(sender.Width, sender.Height / p_1),
new Point(sender.Width, sender.Height - sender.Height / p_1),
new Point(sender.Width - sender.Width / p_1, sender.Height),
new Point(sender.Width / p_1, sender.Height),
new Point(0, sender.Height - sender.Height / p_1) }, (float)p_2);
sender.Region = new Region(oPath);
}
private void BeautiLoginForm_Resize(object sender, EventArgs e)
{
Type(this, 25, 0.1);
}
{
Type(this, 25, 0.1);
}
private void Type(Control sender, int p_1, double p_2)
{
GraphicsPath oPath = new GraphicsPath();
oPath.AddClosedCurve(new Point[] {
new Point(0, sender.Height / p_1),
new Point(sender.Width / p_1, 0),
new Point(sender.Width - sender.Width / p_1, 0),
new Point(sender.Width, sender.Height / p_1),
new Point(sender.Width, sender.Height - sender.Height / p_1),
new Point(sender.Width - sender.Width / p_1, sender.Height),
new Point(sender.Width / p_1, sender.Height),
new Point(0, sender.Height - sender.Height / p_1) }, (float)p_2);
sender.Region = new Region(oPath);
}
private void BeautiLoginForm_Resize(object sender, EventArgs e)
{
Type(this, 25, 0.1);
}
本文介绍了一种使用C#实现窗口圆角效果的方法。通过GraphicsPath和Region对象,可以为Windows窗体创建平滑的圆角边界。这种方法适用于希望增强应用程序用户界面视觉效果的开发者。
1496

被折叠的 条评论
为什么被折叠?



