Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can i detect that a form is al created

Posted on 1998-01-29
1
Medium Priority
?
139 Views
Last Modified: 2010-04-04
In a MDI application i want to detect that a mdi child is
already created.
0
Comment
Question by:gipa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
ZifNab earned 300 total points
ID: 1357848
Iterate through the MDI childs and check the name.

To limit to only one mdi child, you can use this code
(from uddf)

 ChildIndex := 0
  while (ChildIndex < frmMDIParent.ChildCount) and
          (frmMDIParent.MDIChildren[ChildIndex].Name <> frmNewChild.Name) do
    Inc(ChildIndex);
  if ChildIndex = frmMDIParent.ChildCount then
    {create new child here}
    begin
       Create it...
       if no exception occurred, then show it...
    end
  else
    {child form already exists so just bring it to the top}
    frmMDIParent.MDIChildren[ChildIndex].BringToFront;

or maybe this

How about,



        if Form1 <> nil then
        begin
                Form1 := TForm1.Create(Application);
                Form1.Show;
        end;



Then in Form1's OnClose:



        Action := caFree;
        Form1    := nil;


0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question