在解决fsMDIChild窗口"闪"的问题后,又出现主窗口镂空(锁定过程中)的问题 
应该是函数  Perform()引起的,如果在App.CreateForm(fForm,mForm);  
后加个showmessage();就很明显地看到这个问题了解决"闪"的过程如下:   
procedure       MDIChildshow(FrmName:       string;Frmmain:       TForm;       mForm:       TForm;fForm:       TFormClass;App:       TApplication);   
begin   
                            Frmmain.Perform(WM_SETREDRAW,0,0);   
                            if       Application.FindComponent(FrmName)=nil       then   
                            try   
                                            App.CreateForm(fForm,mForm);
                                            showmessage(FrmName+'创建成功!');      
                            except   
                                            showmessage(FrmName+'创建不成功!');   
                            end;   
                            mForm.Show;   
                            Frmmain.Perform(WM_SETREDRAW,1,0);   
                RedrawWindow(Frmmain.Handle,nil,0,RDW_FRAME+RDW_INVALIDATE+RDW_ALLCHILDREN+RDW_NOINTERNALPAINT);   
end;
拜请高人指点,感激涕淋!!!

解决方案 »

  1.   

    使用SendMessage()和ClientHandle参数可以解决
    sendmessage(ClientHandle,WM_SETREDRAW,0,0);
    ...
    sendmessage(ClientHandle,wm_setredraw,1, 0);
    RedrawWindow(ClientHandle,nil,0,RDW_FRAME+RDW_INVALIDATE);
      

  2.   


    使用fsMDIChild 属性的窗体 创建时会在 主窗体中“闪”获得焦点 创建窗体 再放大 等有几个过程  象动画一样
      

  3.   

    //可以用下面这段代码;
    //使用LockWindowUpdate()函数,可以减少窗体打开的闪烁现象;begin
      if not Assigned(ChildForm) then
      begin
        LockWindowUpdate(Handle);
        if not MDIEnable then CloseWindows;  //关闭其它可能打开着的窗口
        ChildForm:= TChildForm.Create(Application);
        LockWindowUpdate(0);
      end
      else ChildForm.Show;
    end;