这种事怎么还扎堆啊,昨天刚有个帖子
http://topic.csdn.net/u/20111031/22/68306454-2046-4620-9234-b846779e56c4.html?80071
那个Lz貌似研究的比较多的说

解决方案 »

  1.   

    在那上面放窗体就别用mdi,用普通窗体,设置其parent,就用普通的show即可
      

  2.   

    说明一下用意:
    我想让我的系统能支持多窗口操作,即SHOW的方式.要多窗口融合在一个窗口内方便在不同的窗口之前切换
      

  3.   

    提供一个过程,供参考:procedure PageAddForm(aPage:TRZpageControl;aForm:TForm;TaFormClass:TClass);
    begin
        application.CreateForm(TComponent(TaFormClass),aForm);
       aForm.MaualDock(aPage));  //融合至pageControl,
       aForm.Visible:=true;              //这个比用 show效果更好
       aPage.ActivePageindex:=aPage.PageCount-1;
    end;
    注意:在调用之前,先检查一下aPage上是否已融合的当前要融合的表单,
    如果已融合,则切换到对应的Tabsheet,否则调用。
    融合之后,生成的Tabsheet.caption为表单的caption
    因此通过
       for i:=0 to aPage.PageCount-1 进行遍历查找即可。
       ......当然,这个检查过程也可以加在PageAddForm中去,加个参数就行了。仅供参考。
      

  4.   

    我以前好像是用setparent 做的,呵呵
      

  5.   

    是的,但是用setParent必须先动态生成一个tabSheet,而且还要手工释放,用MaualDock,则不要手工生成与释放。方便了很多。
      

  6.   

    不知道这是不是楼主想要的啊:
    http://blog.csdn.net/sdudubing/article/details/6790374
      

  7.   


    用MaualDock会引起原来的很多事件响应时都出错。帮忙看看我这样哪里不对?能实现就是打开后里面的其它按扭事件不正常了。之前直接用showmodal打开窗体时其它所有都正常的。用以边的方式打开就其它很多事件都出问题了。
    代码如下:
    procedure Tmainform.dxBarButton8Click(Sender: TObject);
    begin
      with(Tflbm.Create(nil)) do
      begin
        Caption:=flbm.Caption;
        ManualDock(RzPageControl1,nil,alClient);
        RzPageControl1.ActivePageIndex:=RzPageControl1.PageCount-1;
        show;
      end;
    end;
      

  8.   

    http://blog.csdn.net/smallhand/article/details/4542152
      

  9.   


    请问如何在打开新窗口的事件中调用你的过程?老是报错呀?可否举个调用实例?比如我想打开FORM2窗口是怎么调用的?
      

  10.   

    比如这个过程是建立在主程序mainform中
    将这个过程定义在private中比如在button1的OnClick调用:PageAddForm(aPage,Form2,TForm2);//其中aPage就是你想融合的目标rzPageControl
      

  11.   


    你好,加了你写的过程后运行报错:
    [错误] mainformpas.pas(709): Incompatible types: 'TComponentClass' and 'TComponent'
    [错误] mainformpas.pas(710): Undeclared identifier: 'MaualDock'
    [错误] mainformpas.pas(710): 'END' expected but ')' found
      

  12.   

    因为你是作为主表单的 局部过程,所以实现部分要加上主表单的类名procedure Tfm_MainForm.PageAddForm(aPage:TRZpageControl;aForm:TForm;TaFormClass:TClass);
    begin
        ......
    end;
      

  13.   

    我的主窗口为mainform
    目前过程如下:
    procedure Tmainform.PageAddForm(aPage:TRZpageControl;aForm:TForm;TaFormClass:TClass);
    begin
        application.CreateForm(TComponent(TaFormClass),aForm);
       aForm.MaualDock(aPage));  //融合至pageControl,
       aForm.Visible:=true;              //这个比用 show效果更好
       aPage.ActivePageindex:=aPage.PageCount-1;
    end;
      

  14.   

    再浪费一下CSDN的资源,刚做了简单的测试给你。unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, RzTabs;type
      TForm1 = class(TForm)
        page1: TRzPageControl;
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
        procedure PageAddForm(mform:TForm;TmFormClass:TClass);
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementationuses Unit2;{$R *.dfm}{ TForm1 }procedure TForm1.PageAddForm(mform: TForm; TmFormClass: TClass);
    begin
        application.CreateForm(TcomponentClass(TmFormClass),mForm);
        // mForm.show;
        mForm.ManualDock(page1);
        mForm.Visible :=true; //这种方法的效果比用 show的效果要好一些
        page1.ActivePageIndex :=page1.PageCount-1;
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
       pageAddForm(Form2,TForm2);
    end;end.
    ============================unit Unit2;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm2 = class(TForm)
        Label1: TLabel;
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form2: TForm2;implementation{$R *.dfm}end.
      

  15.   


    非常感谢你的热心解答,目前已能运行并且能调用。
    不过有一点我搞不明白,为什么以这种方式打开窗口后凡是遇到FocusControl(***) ;都要出错呢?有没有办法可以解决?
      

  16.   

    使用tgbd提供的方法已能将窗口融合于gzpagecontrol,但有错误提示。如下图:
      

  17.   

    http://hi.csdn.net/attachment/201111/5/6256647_1320482906pUBb.jpg
      

  18.   

    FocusControl(***)改成****.stFocus;你是不是这个意思,让某控件获取焦点?
      

  19.   

    你是不是想让控件获取焦点啊,用例 edit1.setfocus;
      

  20.   


    你说得对,就是。不过除了改成****.setfocus;有没有别的办法?因为使用FocusControl(***)太多了。
    另外除了FocusControl(***)会有问题外还有其它的问题哦?经单步调试发现走到这里:if flbm.ADOQuery1parent.IsNull then   也会出现上图这个提示。有没有人知道这是什么意思?该如何解决?
      

  21.   

    按高手 提供的方法  TRzPageControl多窗口的融合   成功,  那么请问 如何 取消  多窗口的融合(关闭已融合的窗口)...我 取消不了了.....