把标题栏去掉,或者不响应 WM_NCLBUTTONDOWN 消息试试

解决方案 »

  1.   

    重载窗体的HIT TEST检测为标题栏的话,返回另外一个HIT TEST 值
      

  2.   

    http://www.cnblogs.com/skyiv/archive/2005/10/05/WndProc.html
      

  3.   

    using System; 
    using System.Windows.Forms; 
    using System.Runtime.InteropServices; class Test : Form 

      const int MF_BYPOSITION = 0x0400; 
      const int MF_REMOVE     = 0x1000;   [DllImport("user32.dll",EntryPoint="GetSystemMenu")] 
      extern static IntPtr GetSystemMenu(IntPtr hWnd, IntPtr bRevert);   [DllImport("user32.dll",EntryPoint="RemoveMenu")] 
      extern static int RemoveMenu(IntPtr hMenu, int nPos, int flags);   Test() 
      { 
        Text            =  "不能移动和改变大小的窗口"; 
        FormBorderStyle = FormBorderStyle.FixedSingle; 
        MaximizeBox     = false; 
        MinimizeBox     = false; 
        RemoveMenu(GetSystemMenu(Handle,IntPtr.Zero),1,MF_BYPOSITION|MF_REMOVE); 
      }   static void Main() 
      { 
        Application.Run(new Test()); 
      } 
      

  4.   

    // 第2种解决方案: 去掉标题栏的系统菜单, 不如第1种using System.Windows.Forms;
    class Test : Form 

      Test() 
      { 
        Text            = "去掉系统菜单的标题栏"; 
        FormBorderStyle = FormBorderStyle.FixedSingle; 
        MaximizeBox     = false; 
        MinimizeBox     = false; 
      } 
      const int WS_SYSMENU = 0x00080000;
      protected override CreateParams CreateParams 
      { 
        get 
        { 
          CreateParams cp =  base.CreateParams; 
          cp.Style = cp.Style & ~WS_SYSMENU; 
          return cp; 
        } 
      } 
      static void Main() 
      { 
        Application.Run(new Test()); 
      } 
      

  5.   

    如果你是winform程序的话,可以这么做,把窗体的fomrborderstyle设置为FixedSingle\Fixed3D都行然后把maximizebox设置为false这样鼠标就不能拖拽你的窗体了