views:

93

answers:

1

I am experiencing an hard-to-track problem: when showing new forms (I create and show them at runtime) sometimes the form is minimized.

I don't understand why, I say this problem in xp, Vista and 7.

I tried to create samples to isolate the problem but on the samples I cannot reproduce it (=the forms always show not minimized).

What happens is:

in my application I create and show many forms (user clicks on menu item - a form is created and shown). Sometimes, randomly, the form is also minimized in the application bar. So i need to click on it and it is restored again...

Does anyone has a clue of why this happens? If I have an hint at least I can try to find and fix the problem.

I use Delphi 2009 and DevExpress VCL.

A: 

At runtime:

Form := TMyForm.Create;
Form.Show;
Form.WindowState := fsNormal;

If you don't use any state-saving components, then better reverse last two actions:

Form := TMyForm.Create;
Form.WindowState := fsNormal;
Form.Show;
ThinkJet