怎样建立一个无标题的窗口,并且窗口可以调整大小

解决方案 »

  1.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
      SetWindowLong(Form1.Handle,
                    GWL_STYLE,
                    GetWindowLong(Handle,GWL_STYLE) and not WS_CAPTION);
      Height := ClientHeight;
    end;
    ///////////////////////////////////////////////////////////
    procedure TForm1.CreateParams(var Params: TCreateParams);
    begin
      inherited createparams(params);
      with params do
      begin
        style:=style and (not ws_caption);
        style:=style or ws_popup or ws_thickframe or ws_clipchildren;
      end;
    end
      

  2.   

    为什么那么复杂来.把borderstyle设为bsnone不好嘛
    而且楼上的代码也没有调整大小的能力吧..
      

  3.   

    呵呵。borderstyle设为bsnone多好。
      

  4.   

    private
        { Private declarations }
        procedure CreateParams(VAR Params: TCreateParams); override;procedure TForm1.CreateParams(VAR Params: TCreateParams);
    begin
      Inherited CreateParams(Params);
      WITH Params DO
        Style := (Style OR WS_POPUP) AND (NOT WS_DLGFRAME);
      end;
      

  5.   

    borderstyle设bsnone放一个Image,放一张图片
    然后在onmousedown中加入代码:
    procedure TForm1.ResizeBtnMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    const SC_DRAGMOVE:Longint=$F008;//这个数字你可以改,自己看看效果
    begin
    if (Self.WindowState=wsNormal) then
      begin
      ReleaseCapture;
      SendMessage(Self.Handle,WM_SYSCOMMAND,SC_DRAGMOVE,0);        //向窗体发送改变大小消息
      end;
    end;
      

  6.   

    把BorderICons中的所有设为false,就可以了。
      

  7.   

    procedure TForm1.CreateParams(VAR Params: TCreateParams);
    begin
      Inherited CreateParams(Params);
      WITH Params DO
        Style := (Style OR WS_POPUP) AND (NOT WS_DLGFRAME);
      end;