Solved

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

Posted on 1998-12-10
6
225 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
[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 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
Independent Software Vendors: 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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