见http://www.codeproject.com/csharp/SmartDragDrop.asp
可以下载代码示例。不过需要注册。可以告诉我你的邮箱,我给你发过去。

解决方案 »

  1.   

    楼主试下这个代码是否符合题意:private Point m_StartPoint;
    private Rectangle m_Rect;
    private Rectangle m_oRect;
    private void label1_MouseDown(object sender, MouseEventArgs e)
    {
    if (e.Button == MouseButtons.Left)
    {
    this.m_StartPoint = e.Location;
    this.m_Rect = this.label1.Bounds;
    this.m_oRect = this.m_Rect;
    }
    }private void label1_MouseMove(object sender, MouseEventArgs e)
    {
    if (this.label1.Capture)
    {
    this.m_Rect.X += e.X - this.m_StartPoint.X;
    this.m_Rect.Y += e.Y - this.m_StartPoint.Y;
    this.label1.Bounds = this.m_Rect;
    }
    }private void label1_MouseUp(object sender, MouseEventArgs e)
    {
    if (!this.ClientRectangle.Contains(this.m_Rect))
    {
    this.label1.Bounds = this.m_oRect;
    }
    }
      

  2.   

    這是我做的子窗范围控制在主窗體內,看看是否對你有用
    http://www.cnblogs.com/scottckt/archive/2007/08/28/872871.html