1.首先写方法:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LoginInterface
{
class designForm
{ public 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(oPat

本文介绍了如何使用C#在WinForm应用程序中实现窗体和控件的圆角化。通过自定义方法并在相应事件中调用,可以轻松达到圆角效果,从而提升用户界面的视觉体验。

2132

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



