Solved

Minimise forms

Posted on 2007-03-27
6
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

705 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