Solved

Minimise forms

Posted on 2007-03-27
6
176 Views
Last Modified: 2010-04-05
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
Comment
Question by:Alpha_AI
6 Comments
 
LVL 6

Expert Comment

by:Hardi
ID: 18798991
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
 

Author Comment

by:Alpha_AI
ID: 18799019
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
 
LVL 6

Expert Comment

by:Hardi
ID: 18799054
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 11

Expert Comment

by:A. Cristian Csiki
ID: 18799668
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
 
LVL 4

Accepted Solution

by:
spk2000ar earned 125 total points
ID: 19113228
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
 
LVL 4

Expert Comment

by:spk2000ar
ID: 19113239
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

758 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