0

Possible Duplicate:
How to minimize a window to the taskbar? (i.e. not iconify)

I want to show some form before showing the main form in my app, I do:

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}

begin
  with TForm2.Create(Application) do
    try
      ShowModal;
    finally
      Free;
    end;

  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

It's working properly but when I minimizing first form (TForm2) it's doing something like this (not minimizing to taskbar):

Minimize problem

What's wrong?

Community
  • 1
  • 1
JustMe
  • 2,329
  • 3
  • 23
  • 43

1 Answers1

1

Try to Hide it before you Free first. I don't know but if your first form is an authentication form maybe you could also use ModalResult to be sure that the user's response was ok.

Hope this helps.

Jenaro
  • 61
  • 1
  • 3
  • 2
    The question isn't about hiding or freeing the form. Before the form is freed -- while it's still visible and the user is interacting with it -- it apparently doesn't minimize properly, as shown in the picture. – Rob Kennedy Aug 12 '11 at 15:24
  • You're right, this could be related to the kind of form he's using, SDI or MDI? – Jenaro Aug 12 '11 at 16:09