怎么样实现窗体的停靠??
(也就是说我要把新打开的一个窗体停靠在原来的窗体上,应该怎样实现呢?)
谢谢帮忙!!

解决方案 »

  1.   

    1.在窗口的ONCREATE事件中设置TOP,LEFT属性值就可以!
    2.可以读写.INI文件保存上一次的位置!
      

  2.   

    楼上说的对啊,动态生成时也可以在Create后Show前设其Top与Left,其值参比原窗体就OK了
      

  3.   


    在main的Panel1窗体上显示FrmClientApplication.CreateForm(TFrmClient, FrmClient);
    FrmClient.Dock(Panel1, BoundsRect);
    FrmClient.Show;
      

  4.   

    用组建了
    ABC,ToolBar2000,Raize那些的
      

  5.   

    procedure TFormSub.FormShow(Sender: TObject);
    var
      ScreenWidth,ScreenHeight: integer;
      posY: integer;
    begin
      //--表示座標の設定
      ScreenWidth := GetDeviceCaps(GetDC(GetDesktopWindow), HORZRES);
      ScreenHeight:= GetDeviceCaps(GetDC(GetDesktopWindow), VERTRES);  if ((ScreenWidth - FormMain.Left)>FormSub.Width then 
        FormSub.Left := FormMain.Left + 7
      else
        FormSub.Left := ScreenWidth - FormSub.Width;  posY := FormMain.Top +  60;
      if ((ScreenHeight - posY) > FormSub.Height) then
        FormSub.Top := posY
      else
        FormSub.Top := ScreenHeight - (FormSub.Height+30);
    end;(注:参照FormMain和Screen算FormSub的位置)