DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: pesamo
今日帖子: 16
在线用户: 13
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 sghyvhk (菜鸟哥) ★☆☆☆☆ -
普通会员
2003/9/30 20:54:24
标题:
Help me!!!!! 浏览:2193
加入我的收藏
楼主: 按此在新窗口浏览图片
请问如何设置MDI窗体,并如何在主窗体调用子窗体?如有不清楚请跟贴,谢了!!!!菜鸟哥,想向你们学武功秘藉

----------------------------------------------
-
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2003/9/30 21:17:10
1楼: 1)可以新建立一个 MDI工程 ,文件\新建
   在弹出的 对话框中选择:project \ mdi application
2)或 :把 FORM1的formstyle设置成 fsMDIForm
       把 FORM2的formstyle设置成 fsMDIChild
3)调用
procedure TMainForm.FileSaveItemClick(Sender: TObject);
var
 str1,str2,str3,temp,s1,s2:string;
 i,j,count:integer;
begin
 temp:= (mainform.ActiveMDIChild as TMDIChild).Caption;
 str1:=copy((mainform.ActiveMDIChild as TMDIChild).Caption,0,6) ;
 if str1='未命名' then
   begin//22
     if sd1.Execute then
     begin//4
      if sd1.FileName=' then exit;
      (mainform.ActiveMDIChild as TMDIChild).
              memo1.Lines.SaveToFile(sd1.FileName);
      (mainform.ActiveMDIChild as TMDIChild).Caption:=sd1.FileName;
      (mainform.ActiveMDIChild as TMDIChild).sb2.SimpleText :=';
      SetPathStatus(sd1.FileName);
       for i:=0 to mainform.MDIChildCount-1 do
         begin//2
          s1:=GetEditedName(temp);
          s2:=TabControl1.Tabs.Strings [i];
          if s1=s2 then
            begin//3
             TabControl1.Tabs.Strings [i]:=OnlyFileName(sd1.FileName );
             break;
            end;//3
         end;//2
     end//4
     else
       exit;
   end//22
   else
   begin//2_2
   str2:=(mainform.ActiveMDIChild as TMDIChild).Caption;
   str2:=copy(str2,length(str2),1);
   
   if (mainform.ActiveMDIChild as TMDIChild).sb2.SimpleText='*' then
   begin//3
    str3:=GetEditedName((mainform.ActiveMDIChild as TMDIChild).Caption);
    (mainform.ActiveMDIChild as TMDIChild).
                      memo1.Lines.SaveToFile(str3);
    (mainform.ActiveMDIChild as TMDIChild).sb2.SimpleText:=';
    (mainform.ActiveMDIChild as TMDIChild).Caption:=str3;
     SetPathStatus(str3);
   end//3
   else
   begin//3_2
    str3:=(mainform.ActiveMDIChild as TMDIChild).Caption;
    SetPathStatus(str3);
   end;//3_2
   end;//2_2
RefreshNextTime;

end;

----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
作者:
男 sealcheng (chengcheng) ★☆☆☆☆ -
普通会员
2003/10/1 19:00:19
2楼: 不会把 这么麻烦!!
楼主 你是说得这个意思么????
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行39.0625毫秒 RSS