windows无边框窗体移动设置

 int cx;         int cy;     

  private void btnClose_Click(object sender, EventArgs e)      

   {             this.Close();         }            

   private void btnClose_MouseLeave(object sender, EventArgs e)        

{             btnClose.BackColor = Color.Transparent;         }

   private void btnClose_MouseMove(object sender, MouseEventArgs e)        

{             btnClose.BackColor = Color.Red;         }

  private void panel1_MouseDown(object sender, MouseEventArgs e)        

{             if (e.Button == MouseButtons.Left)            

         {                 cx = e.X;             

                             cy = e.Y;        

         }       

  }

   private void panel1_MouseMove(object sender, MouseEventArgs e)        

{             if (e.Button == MouseButtons.Left)            

               {             this.Left += e.X - cx;             

                              this.Top += e.Y - cy;           

                }        

}

 

windows无边框窗体移动设置,布布扣,bubuko.com

windows无边框窗体移动设置

上一篇:AcWing P378 骑士放置 题解


下一篇:CF449C Jzzhu and Apples (筛素数 数论?