November 16th, 2012, 05:41 AM
Automatic show of Form after Create it
I'm making maintenance in a legacy application. In some place a Form is created(e.g., the Create method is called) and the form is created and showed without explicit call to Show method.
I try to modify certains properties of the Form but I can't discover what's happening and/or change this Form behaviour.
I would never see this type of form usage.
Could someone explain me wht's happening here?
Greetings from São Paulo - Brazil
November 16th, 2012, 10:23 AM
Forms have a visible Property.
If a Form is a MDIChild this property is set to true and can't be changed to false.
November 16th, 2012, 11:17 AM
1. If this is the reason, why events On Show e OnActivate occur before que call to Create on the MDIParent form ends?
2. I try to change the FormStyle property of the child form to fsMDIForm, fsNormal and fsStayOnTop and the described form behaviour doesn't change anyway...
November 16th, 2012, 12:14 PM
I'm not sure if I understood you right. Do you mean
procedure TForm4.FormCreate(Sender: TObject);
procedure TForm4.FormShow(Sender: TObject);
"After call" will be shown last.
If you need a MDICHild you have no Option ... you have to find to place your required code.
If you won't need MDIChild, just change Formstyle to normal, uncheck visible and remove it from automatic creation in your project.
November 16th, 2012, 01:41 PM
You catch the idea and solve my doubts about this matter.