没人会么?我只知道没有控件时的做法;
***************
怎样可以不要Form的标题栏和边界但可以保留改变Form的大小的功能:
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;type
  TForm1 = class(TForm)
  private
    procedure WmNCHitTest(var Msg : TWMNCHitTest); message WM_NCHITTEST;    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}procedure TForm1.WmNCHitTest(var Msg: TWMNCHitTest);
const v=10; //border width
var p:TPoint;
begin
  p:=Point(Msg.XPos,Msg.YPos);
  p:=ScreenToClient(p);
  if PtInRect(Rect(0,0,v,v),p) then
    Msg.Result:=HTTOPLEFT
  else if PtInRect(Rect(Width-v,Height-v,Width,Height),p) then
    Msg.Result:=HTBOTTOMRIGHT
  else if PtInRect(Rect(Width-v,0,Width,v),p) then
    Msg.Result:=HTTOPRIGHT
  else if PtInRect(Rect(0,Height-v,v,Height),p) then
    Msg.Result:=HTBOTTOMLEFT
  else if PtInRect(Rect(v,0,Width-v,v),p) then
    Msg.Result:=HTTOP
  else if PtInRect(Rect(0,v,v,Height-v),p) then
    Msg.Result:=HTLEFT
  else if PtInRect(Rect(Width-v,v,Width,Height-v),p) then
    Msg.Result:=HTRIGHT
  else if PtInRect(Rect(v,Height-v,Width-v,Height),p) then
    Msg.Result:=HTBOTTOM;
  //Inherited;
end;end.

解决方案 »

  1.   

    在你的Form上放一个TApplicationEvents控件,
    在它的OnMessage事件中
    如果是WM_MOUSEMOVE,
    判断Curosor在Form的什么位置,设置相应的光标,
    如呆是WM_LBUTTONDOWN,
    判断Curosor在Form的什么位置,
    SendMessage(Handle, WM_NCLBUTTONDOWN, ...),省略的为相应的HITTEST值.
      

  2.   

        procedure WMNCHITTEST(var Message : TWMNCHITTEST) ; Message WM_NCHITTEST;procedure TShowLog_FM.WMNCHITTEST;
    begin
      inherited;
        if Message.Result =  HTCLIENT then
            Message.Result := HTCAPTION;
    end;
      

  3.   

    哟那样以下的代码,先让窗口在开启时具有可推动的边框
    procedure CreateParams(var Params: TCreateParams); override;procedure TFormMain.CreateParams(var Params: TCreateParams);
    begin
      inherited CreateParams(Params);
      with Params do
      begin
        Style:=(Style or WS_POPUP) xor (ws_dlgframe);
        ExStyle:=ws_ex_clientedge;
      end;
    end;然后在FormCanResize事件中自己写代码,比如可不可以该窗口的大小,和改到多少大小等等,
    我做了一个程序实现了这个功能,但是太大了,我发给你吧
      

  4.   

    用以下的代码,先让窗口在开启时具有可推动的边框
    procedure CreateParams(var Params: TCreateParams); override;procedure TFormMain.CreateParams(var Params: TCreateParams);
    begin
      inherited CreateParams(Params);
      with Params do
      begin
        Style:=(Style or WS_POPUP) xor (ws_dlgframe);
        ExStyle:=ws_ex_clientedge;
      end;
    end;然后在FormCanResize事件中自己写代码,比如可不可以该窗口的大小,和改到多少大小等等,
    我做了一个程序实现了这个功能,但是太大了,我发给你吧
      

  5.   

    用以下的代码,先让窗口在开启时具有可推动的边框
    procedure CreateParams(var Params: TCreateParams); override;procedure TFormMain.CreateParams(var Params: TCreateParams);
    begin
      inherited CreateParams(Params);
      with Params do
      begin
        Style:=(Style or WS_POPUP) xor (ws_dlgframe);
        ExStyle:=ws_ex_clientedge;
      end;
    end;然后在FormCanResize事件中自己写代码,比如可不可以该窗口的大小,和改到多少大小等等,
    我做了一个程序实现了这个功能,但是太大了,我发给你吧
      

  6.   

    你只要将你的
    procedure TForm1.WmNCHitTest(var Msg: TWMNCHitTest);
    const v=10; //border width
    var p:TPoint;
    begin
      p:=Point(Msg.XPos,Msg.YPos);
      p:=ScreenToClient(p);
      if PtInRect(Rect(0,0,v,v),p) then
        Msg.Result:=HTTOPLEFT
      else if PtInRect(Rect(Width-v,Height-v,Width,Height),p) then
        Msg.Result:=HTBOTTOMRIGHT
      else if PtInRect(Rect(Width-v,0,Width,v),p) then
        Msg.Result:=HTTOPRIGHT
      else if PtInRect(Rect(0,Height-v,v,Height),p) then
        Msg.Result:=HTBOTTOMLEFT
      else if PtInRect(Rect(v,0,Width-v,v),p) then
        Msg.Result:=HTTOP
      else if PtInRect(Rect(0,v,v,Height-v),p) then
        Msg.Result:=HTLEFT
      else if PtInRect(Rect(Width-v,v,Width,Height-v),p) then
        Msg.Result:=HTRIGHT
      else if PtInRect(Rect(v,Height-v,Width-v,Height),p) then
        Msg.Result:=HTBOTTOM;
      //Inherited;
    end;
    换成:procedure TForm1.WMNCHITTEST;
    begin
      inherited;
        if Message.Result =  HTCLIENT then
            Message.Result := HTCAPTION;
    end;就可以了吧!
      

  7.   

    不好用,我在上面放了一个 TFlatTabControl 然后用 SetWindowRgn 切割窗体,窗体并不能接受 MouseMove 事件,......
      

  8.   

    Vestige,把你的E-MAIL给我,我做个例了MAIL给你好了(XZYLZH.163.NET)
      

  9.   

    我好长一段时间没上网了,我的E_Mail是 [email protected]