首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 动画效果浮动窗体实例

动画效果浮动窗体实例

  • 资源大小:0.07M
  • 上传时间:2021-07-18
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: C#语言基础

资 源 简 介

        private void StopRectTimer_Tick(object sender, EventArgs e)        {            //如果鼠标在窗体上,则根据停靠位置显示整个窗体              if (this.Bounds.Contains(Cursor.Position))            {                switch (this.StopDock)                {                    case AnchorStyles.Top:                        this.Location = new Point(this.Location.X, 0);                        break;                    case AnchorStyles.Bottom:                        this.Location = new Point(this.Location.X, Screen.PrimaryScreen.Bounds.Height - this.Height);                        break;                    case AnchorStyles.Left:                        this.Location = new Point(0, this.Location.Y);                        break;                    case AnchorStyles.Right:                        this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Width, this.Location.Y);                        break;                }            }            else  //如果鼠标离开窗体,则根据停靠位置隐藏窗体,但须留出部分窗体边缘以便鼠标选中窗体              {                switch (this.StopDock)                {                    case AnchorStyles.Top:                        this.Location = new Point(this.Location.X, (this.Height - 3) * (-1));                        break;                    case AnchorStyles.Bottom:                        this.Location = new Point(this.Location.X, Screen.PrimaryScreen.Bounds.Height - 5);                        break;                    case AnchorStyles.Left:                        this.Location = new Point((-1) * (this.Width - 3), this.Location.Y);                        break;                    case AnchorStyles.Right:                        this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - 2, this.Location.Y);                        break;                }            }        }
VIP VIP
0.167914s