这个不知道算不算是,呵呵 panel1为Main_Win主窗体的一个面板 第一个按钮: CloseOtherWin(1,self); if First_Win=nil then Application.CreateForm(TFirst_Win, First_Win); First_Win.Parent:=panel1; First_Win.Left:=20; First_Win.Top:=5; First_Win.Width :=panel1.Width-40; First_Win.Height :=Panel1.Height-40; //800*600:515: First_Win.Show; 第二个按钮: CloseOtherWin(2,self); if Second_Win=nil then Application.CreateForm(TSecond_Win, Second_Win); Second_Win.Parent:=panel1; Second_Win.Left:=20; Second_Win.Top:=5; Second_Win.Width :=panel1.Width-40; Second_Win.Height :=Panel1.Height-40; Second_Win.Show; ----- procedure TMain_Win.CloseOtherWin(i:integer;Sender:TObject); begin if (i<>1) and (First_Win<>nil) then begin First_Win.close; First_Win:=nil; end; if (i<>2) and (Second_Win<>nil) then begin Second_Win.close; Second_Win:=nil; end; end;
----------------------------------------------
充电..........