Author: Tomas Rutkauskas
I want the form only to appear once on the user's desktop regardless of whether it
has focus or not.
Answer:
1 procedure TfmMain.fmAboutClick(Sender: TObject);
2 begin3 ifnot (ActiveMDIChild is TfmAboutBox) then4 TfmAboutBox.Create(Application);
5 end;
6 7 procedure TfmMain.fmAboutClick(Sender: TObject);
8 var9 myAbout: TfmAboutBox;
10 i: integer;
11 begin12 for i := 0 to Screen.FormCount - 1 do13 if (Screen.Forms[i] is TfmAboutBox) then14 myAbout := Screen.Forms[i] as TfmAboutBox; {Form Exists}15 if myAbout = nilthen{didn't find it so create it...}16 myAbout = TfmAboutBox.Create(Application);
17 myAbout.Show;
18 end;