经典的调用窗口函数:调用融合窗口

本文介绍了如何使用Delphi实现融合窗口技术,使多个窗口能在单一界面中高效展示,并附带了具体的实现代码。同时提到了融合窗口的一些局限性,例如快捷键冲突的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


经典的调用窗口函数:调用融合窗口 - yyimen - yyimen的博客

融合窗口是为了浏览多窗口方便,且不太关心窗口最小化和最大化模式。典型的融合窗口,比如Maxthon浏览器,浏览多个网页非常方便;微软眼见融合窗口众望所归,在IE7版本也引入了融合窗口技术,但微软的IE既耗内存又容易崩溃。题外话不多说了。在delphi实现其实也很简单,如上图:
procedure ShowDockForm(FormClass: TFormClass; dockCtrl: TWinControl;
IsMaxed: Boolean);
procedure ShowCaption(ParentCtrl:TWinControl;ACaption:string);
begin
     if ParentCtrl is TRzTabSheet then
      TRzTabSheet(ParentCtrl).Caption := ACaption;
end;
var
i: Integer;
TabCtrl:TRzTabSheet;
Form:TForm;
begin
Screen.Cursor := crHourGlass;
try
     for i := 0 to Screen.CustomFormCount - 1 do
       if Screen.CustomForms is FormClass then
       begin
         if (not (Screen.CustomForms).Visible) then
           (Screen.CustomForms).Visible := True;
         (Screen.CustomForms).BringToFront;
         (Screen.CustomForms).SetFocus;
         TabCtrl := TRzTabSheet(Screen.CustomForms.Parent);
         ShowCaption(TabCtrl,Screen.CustomForms.Caption);
         TRzPageControl(dockCtrl).ActivePageIndex := TabCtrl.PageIndex;
           exit;
       end;
     TabCtrl := TRzTabSheet.Create(dockCtrl);    //dockCtrl
     TabCtrl.PageControl := TRzPageControl(dockCtrl);
     TRzPageControl(dockCtrl).ActivePageIndex := TabCtrl.PageIndex;
     Form := FormClass.Create(TabCtrl);
     with Form do
     try
       ManualDock(TabCtrl);
       ShowCaption(TabCtrl,Caption);
       Show;
       Form.WindowState := wsMaximized;
       Form.Align := alClient;
     except
       Free;
     end;
    
finally
     Screen.Cursor := crDefault;
end;
end;
以上代码是在 Raize 5.X中的TRzPageControl 实现多窗口的融合窗口。
融合窗口也有不足之处,如果两个TForm有相同的TActionList快捷键,只有第一个窗口的快捷键有效。


        
        



        







        
          
            
            评论这张
          
        


          
            
              经典的调用窗口函数:调用融合窗口 - yyimen - yyimen的博客
            
            转发至微博
          
        
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值