• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

Minimise forms

I have an application that I want to be minimized to taskbar at startup.

and also I have a second form which i show when i hold down a key (i have the code to make it show when i hold the key and it works fine)
but i when i minimise on the first form, the second form is minimized too.

When i minimise the first form, I want the first form to remain visible
and how do i set minimise on the form1 at startup.

This is what I have so far on minimize at startup but it doesnt work

  Application.ShowMainForm := false;
  Application.Initialize;

  Application.CreateForm(TForm1, Form1);
0
Alpha_AI
Asked:
Alpha_AI
1 Solution
 
HardiCommented:
To minimize form on startup, you can put this in FormCreate
  Self.WindowState := wsMinimized;

But I'm not sure how to make the second form visible.
0
 
Alpha_AIAuthor Commented:
ok.

When i minimise the first form, I want the second form to remain visible, does any one know how to do that?

Ben
0
 
HardiCommented:
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
A. Cristian CsikiSenior System AdministratorCommented:
If i understood right you wish to display only the 2nd form for a while at start up.:
try this:
pun a timer and set it's interval 10,
ontimer property write:

procedure TForm1.Timer1Timer(Sender: TObject);
begin
form1.hide;
form2.bringtofront;
form2.show;
timer1.enable:=false;
end;

:) good luck,
cheers
0
 
spk2000arCommented:
The second form is something like a splashscreen?
If so, then you can make this with something like this at Source code of project:

begin
  Application.Initialize;
  Application.Title := '...';
  frmSplashScreen := TfrmSplashScreen.Create(Application);
  frmSplashScreen.Show;
  frmSplashScreen.Update;
  while frmSplashScreen.Timer.Enabled do
     Application.ProcessMessages;
  Application.CreateForm(TfmMain, fmMain);
  frmSplashScreen.Hide;
  frmSplashScreen.Free;
  Application.Run;
end;

In frmSplashScreen put a TTimer component named Timer and set the interval to... lets said 3000 (30")? and enabled to TRUE. And at OnTime event put this line of code:

Timer.Enabled := FALSE;

Hope this help!!
0
 
spk2000arCommented:
If last comment is going to the wrong way, review the creation of the forms, are them created by a call to Show method, or ShowModal?
How is set FormStyle in each form? try with fsStayOnTop on second dialog.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now