你可以在mouse_move事件中定義移動距離為0!

解决方案 »

  1.   

    try private void Form_Move(object sender, System.EventArgs e)
    {
      Size sz = SystemInformation.PrimaryMonitorSize;//获取监视器分辨率
      Rectangle rect = this.DesktopBounds;
      if(rect.X < 0)
        this.DesktopBounds = new Rectangle(0,rect.Y,rect.Width,rect.Height);
      if(rect.Y < 0)
        this.DesktopBounds = new Rectangle(rect.X,0,rect.Width,rect.Height);
      if(rect.X > sz.Width - rect.Width)
        this.DesktopBounds = new Rectangle(sz.Width -  rect.Width,rect.Y,rect.Width,rect.Height);
      if(rect.Y > sz.Height - rect.Height)
        this.DesktopBounds = new Rectangle(rect.X,sz.Height - rect.Height,rect.Width,rect.Height);//没有考虑Taskbar
     
    }
      

  2.   

    谢谢FileNewExit((呵呵)) 
    这分是你的了
    但在我原意是在拖动过程中,虚框不能拖出屏幕
    如果有谁解决了,另开帖给分!!!