Solved

Strange Error: from Create automatically jump to ShowForm

Posted on 2009-07-01
7
272 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
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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 36

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now