Solved

Strange Error: from Create automatically jump to ShowForm

Posted on 2009-07-01
7
280 Views
Last Modified: 2012-05-07
I have to re-debug a once running application.
The Error is npw /recently like this:
from the from.Create function (Line #1) to execution immeadiatly jumps to FormShow,
then calling/executing line //2 and then not executing MYForm.Show; because the form is already
visible after Form.Create.
Any ggod idea what might be the reaon ?

Form Properties:

onCreate -> CreateFunction
onShow ->FormShow Function

//1 
MyForm := MyForm.Create(Application)
 
//2
MYForm.firstProperty  := bla; 
MYForm.xxxProperty  := bla bla; 
 
MYForm.Show;

Open in new window

0
Comment
Question by:BdLm
[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
7 Comments
 
LVL 4

Expert Comment

by:JonasMalmsten
ID: 24758741
Look at the forms Visible property in the object inspector, it is probably set to True.
0
 
LVL 8

Author Comment

by:BdLm
ID: 24758778
It is a MDI Form, can't set visible to False :-(
0
 
LVL 4

Expert Comment

by:JonasMalmsten
ID: 24758818
What are the properties you need to set before the form is shown?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Accepted Solution

by:
dougaug earned 250 total points
ID: 24758855
Does the form MyForm has the property formStyle = MdiChild?
If yes, maybe this is the cause, because MDIChild forms become visible when they are created.

Regards,
0
 
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 250 total points
ID: 24760613
check the OldCreateOrder property of the form
set it to false

override the constructor of the mdi child to set properties

  public
    constructor Create(AOwner: TComponent); override;
  end;

constructor TChildForm.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  // set properties here

  // visible becomes true before end (it calls formcreate first, then sets visible to true)
end;
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 24767614
Have you deleted all the DCU's and done a rebuild? Sounds like you may have an old DCU hanging out there in the path somewhere.
0
 
LVL 8

Author Comment

by:BdLm
ID: 24771746
may be I changed this Form from fsnormal to midchild without any further test ...., now changed the code , solution found
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

689 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