手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#圆角窗体简单实现方法
C#圆角窗体简单实现方法
摘要:本文实例讲述了C#圆角窗体简单实现方法。分享给大家供大家参考。具体如下:publicpartialclassForm1:Form{publi...

本文实例讲述了C#圆角窗体简单实现方法。分享给大家供大家参考。具体如下:

public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Resize(object sender, EventArgs 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 Form1_Paint(object sender, PaintEventArgs e) { Type(this, 25, 0.1); } }

希望本文所述对大家的C#程序设计有所帮助。

【C#圆角窗体简单实现方法】相关文章:

C#连接db2数据库的实现方法

解析如何正确使用SqlConnection的实现方法

关于C#程序优化的五十种方法

C#用Lambda和委托实现模板方法

C# SendInput 模拟鼠标操作的实现方法

WinForm子窗体访问父窗体控件的实现方法

c# winform取消右上角关闭按钮的实现方法

Winform跨线程操作的简单方法

解决C#获取鼠标相对当前窗口坐标的实现方法

C#实现对AES加密和解密的方法

精品推荐
分类导航