Solved

Main Form, 2nd form - Minimize Main w/o minimizing 2nd form

Posted on 1998-12-10
6
221 Views
Last Modified: 2010-04-04
This has to be easy.
I have a 2 form application.  I bring up the main form.  One of the functions can display a 2nd form.  Now, I want the user to be able to minimize the main form, without the 2nd form being minimized.  Minimizing the main seems to hide my 2nd one.
0
Comment
Question by:kdw
6 Comments
 
LVL 7

Expert Comment

by:ahalya
ID: 1350502
Well, if i am right you "Minimize" your application, not the forms. so i don't think that you can do this because MainForm.Minimize actually calls Application.Minimize.

You, ofcourse, can hide the MainForm while displaying Form2 if you prefer.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1350503
Hi KDW,

Try this

2 forms

form 1 with 2 buttons
form 2 with 2 buttons

this code in unit1

implementation

uses Unit2;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form1.WindowState := wsMinimized;
  Form2.Show;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Form2.Close;
  Close;
end;

and this code in unit2

implementation

uses Unit1;

{$R *.DFM}

procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2.Hide;
  Form1.WindowState := wsNormal;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
  Form1.Button2Click(Self);
end;

Hope this helps
br(UINT)je.
0
 

Author Comment

by:kdw
ID: 1350504
That would sort of work, but I really need to:
1)have the minimize come from the minimize border icon
2)Have clicking the TaskBar entry for the program bring back the first window
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:BlackMan
ID: 1350505
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1350506
In the closeQuery event of your second form, set Canclose to false. That's all....
0
 

Author Comment

by:kdw
ID: 1350507
Man that was easy.  thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

947 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

21 Experts available now in Live!

Get 1:1 Help Now