开发者

Form not minimizing properly [duplicate]

开发者 https://www.devze.com 2023-03-27 12:46 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to minimize a window to the taskbar? (i.e. not iconify)
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

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

I want t开发者_Python百科o 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):

Form not minimizing properly [duplicate]

What's wrong?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消