窗口默认是可以移动的,如何做才能禁止窗口移动?

解决方案 »

  1.   

    procedure wmposchange(var message: twmwindowposchanging); message wm_windowposchanging;procedure TtwmainFrm.wmposchange(var message: twmwindowposchanging);
    begin
      if (top = 0) and (left = 0) then
        pwindowpos(tmessage(message).lparam).flags := pwindowpos(tmessage(message).lparam).flags or
          swp_nomove; //
      if ((width = screen.Width) or (width = 2 * screen.Width)) and (height = screen.Height) then
        pwindowpos(tmessage(message).lparam).flags := pwindowpos(tmessage(message).lparam).flags or      swp_nosize;end;
    // 1.禁止移動
    // 2.禁止拖拉...
      

  2.   

    align := alCustom;
    就行了
      

  3.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      self.Align:=alcustom;
    end;