• WINFROM窗体实现圆角


    首先我们先看看效果图

    接下来我们看看怎么实现

    先把窗体的FromBorderStyle属性改成None。

    接下来登录窗体代码代码:

    添加一个窗体Paint事件,引用using System.Drawing.Drawing2D;

    private void frmLogin_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);
    }

    再添加窗体Resize事件

    private void frmLogin_Resize(object sender, EventArgs e)
    {
    Type(this, 25, 0.1);
    }

  • 相关阅读:
    gems gems gems
    poj 6206 Apple
    lightoj1341唯一分解定理
    lightoj1370欧拉函数
    约瑟夫环lightoj1179
    拓展欧几里得算法
    RMQ算法
    poj1502MPI Maelstrom
    poj1860Currency Exchange
    生成全排列
  • 原文地址:https://www.cnblogs.com/dakang1/p/9908415.html
Copyright © 2020-2023  润新知