Hi christian_r , my problem is not in Closing the Second Form , my prolem is when i click 4 the Second Time to show the 2nd Form .
Here the 2nd Form is Shown but without Buttons or Labels . Only an empty Form .
Here is a Pseudo Code .
// the Second Form contains : 2 Buttons , 2 Labels .
Delphi-Quellcode:
On MainForm Creat Event
begin
if Not Assigned(SecondForm) then
SecondForm:=TSecondForm.Create(Nil); // here i Create the 2nd Form .
end;
On MainForm Destroy
begin
SecondForm.Release;// the 2nd Form is released
end;
(*
Here when i click on this Button1 the SecondForm is Shown
so 1st Click the Form is Shown Correctly with all its Controls.
the 2nd Click the Form is Shown but without any Controls on It .
Only an Empty Form
*)
On TMainForm.Button1.Click
begin
SecondForm.Label1.caption:={MainForm.}Label1.Caption;
SecondForm.Label2.caption:={MainForm}.Label2.Caption;
if SecondForm.ShowModal=MrOk then
// i have a Function to Execute
end;
Regards