Now with at least 300+ variations of manually created forms I've created in the past 5 years, I've never seen this problem. I have of course a main form, and then a bunch of smaller child forms. These child forms are not auto-create, they're declared and created manually in my code. This project is still very premature, meaning there isn't that much code in this project that I might be missing something. But the problem is, all I do is create the form, assign the parent to the main form, and without any code to show the form, it shows its self anyway.
FControlPanel:= TfrmControlPanel.Create(nil);
FControlPanel.Parent:= Self;
That's all the code I have to create it. Absolutely no code is in the actual child form at all. It should take at least FControlPanel.Show
for it to be visible, but for some reason it's visible anyway.
I do have a hunch what might have caused this behavior to begin with. But I can't put two and two together. I attempted to use the MDI form capabilities, to keep the forms within the main form. But after a number of trial/error scenarios, I gave up and set my properties back. The only properties I changed were the FormStyle - The main form I switched (for trials) between fsMDIForm, fsNormal, and fsStayOnTop. The child forms I switched them to fsMDIChild. After I gave up, I switched them all back to their default, fsNormal. It's after this playing around when this "auto show" started happening.
Also, probably an important note, these child forms are inherited from a master form. This master form practically has no code either, at least no code which might show it. Nowhere in any of my code am I telling it to show these child forms, but it does anyway. And I know they're not auto-creating.
What could I have done wrong?
PS - The problems implementing the MDI in general is subject to another question, I'm not asking about MDI but it may be what caused this to happen, as changing properties of components is known to permanently switch internal properties of the component, for example, on a TPanel, switching "ParentBackground" to true then back to false again causes it to properly show the specified color when using XPMan.
IIRC seting form's style to fsMDIChild
changes the Visible
property of the form to True
. So now whenever you create a form it is visible by default... change the forms Visible property back to False
and it should end the "auto show" behaviour.