Solved

Strange Error: from Create automatically jump to ShowForm

Posted on 2009-07-01
7
279 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
Technology Partners: 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Delphi Spellcheck in Webbrowser 1 75
QRReport  TQrmemo vertical stretching 1 64
How to renew a Delphi rad-studio licence? 5 92
RESTRequest Parameter 4 77
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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