主要代码

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_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 Form1_Resize(object sender, EventArgs e)
        {
            Type(this, 25, 0.1);
        }

        Point _Location;
        Boolean _Down = false;
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                _Location = new Point(e.X, e.Y);
                _Down = true;
            }
        }

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && _Down == true)
            {
                this.Left += e.X - _Location.X;
                this.Top += e.Y - _Location.Y;
            }
        }

        private void Form1_MouseUp(object sender, MouseEventArgs e)
        {
            _Down = false;
        }
    }

最新文章

  1. Python学习路程day17
  2. qml支持多平台的编译--尤其对于需要支持xp的情况
  3. hdu 4662 MU Puzzle
  4. MySQL 索引、视图、DML
  5. arm-linux-gcc 安装和测试
  6. [译]Stairway to Integration Services Level 3 - 增量导入数据
  7. 【杂谈】没有公网IP的电脑如何与外部通信
  8. scrapy之五大核心组件
  9. Gym - 101755G Underpalindromity (树状数组)
  10. luogu 1550 [Usaco2008 Oct]打井 最小生成树+小技巧
  11. Python 合并两个列表的多种方式,合并两个字典的多种方式
  12. nowcoder 寻找(LCA)
  13. svn强制commit写log
  14. mysql主从配置思路
  15. 关于Maven整合SSM项目中报错Invalid bound statement (not found):的问题解决
  16. if语句和switch语句
  17. binlog、redo log、undo log区别
  18. java 编码问题
  19. git 忽略文件 .gitignore 以及规则
  20. javaweb(三十七)——获得MySQL数据库自动生成的主键

热门文章

  1. QTP参数化
  2. SpringBoot的基础Pom
  3. 脚本工具: 查看当前系统被写入的FD
  4. leetcode 191
  5. webservice wsdl接口配置与调用
  6. 手持机(Android)开发应用总结
  7. for..in遍历,枚举器
  8. Windows Server 2008下asp+access无法登陆问题总结
  9. 通过类名获取spring里的Bean
  10. 树莓派(rasperberry pi 2)上装mysql远程无法访问