程序运行点击 房间信息和租房信息 标签出来两个后 再点击上面图片租房信息如图
标签老是显示在房间信息里 不能显示在租房信息标签里 窗口都是对的 标签显示不对 怎么回事啊 ???
通过这个函数 打开子窗口 房间信息和租房信息 都是子窗口 rzpagecontrol 是单独用来显示标签头的
procedure OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
var
i, j: integer;
Child:TForm;
tsTemp:TRzTabSheet;
str: string;
begin
Frm_Main.CloseChild:=false;
for i := 0 to Screen.FormCount -1 do
if Screen.Forms[i].ClassType=FormClass then
begin
Child:=Screen.Forms[i];
if Child.WindowState=wsMinimized then
ShowWindow(Child.handle,SW_SHOWNORMAL)
else
ShowWindow(Child.handle,SW_SHOWNA);
if (not Child.Visible) then Child.Visible:=True;
Child.BringToFront;
Child.SetFocus;
TForm(fm):=Child;
str := TForm(fm).Name;
j := frm_Main.frmCaption.IndexOf(str);
frm_Main.PageControl1.ActivePageIndex := j;
Exit;
end;
Child:=TForm(FormClass.NewInstance);
TForm(fm):=Child;
Child.Create(AOwner);
tsTemp := TRzTabSheet.Create(Frm_Main.pagecontrol1);
tsTemp.Caption :=TForm(fm).Caption;
tsTemp.PageControl:=Frm_Main.pagecontrol1;
tsTemp.Hint:=TForm(fm).Name;
Frm_Main.frmCaption.Add(tsTemp.Hint);
Frm_Main.pagecontrol1.ActivePage:=tsTemp;
Frm_Main.PageControl1.ShowCloseButtonOnActiveTab:=True;
end;