?
Solved

How to minimize only main form and not all windows?

Posted on 2003-04-01
11
Medium Priority
?
239 Views
Last Modified: 2010-04-06
Hi,

I have an application with different forms. When I minimize the main form, all other windows are minimized too!!! The other windows are bsToolWindow's, so not normal windows. They have no 'Minimize' button...
Is it possible to minimize ONLY the main window and that the oter bsToolWindow's will stay visible???


thanks
0
Comment
Question by:Bohne
[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
  • 8
  • 3
11 Comments
 
LVL 3

Expert Comment

by:lmikle
ID: 8246704
for example, you can create yours tool windows with set parent to desktop.

1. Remove your tool windows from autocreate.
2. In OnCreate of main form create those windows using CreateParented contructor:

procedure TForm1.Form1Creare(Sender);
begin
  TW1 := TToolWin1Form.CreateParented(GetDesktopWindow);
  TW2 := TToolWin2Form.CreateParented(GetDesktopWindow);
end;

don't forget to free TW1 and TW2 in OnDestroy event.
0
 

Author Comment

by:Bohne
ID: 8246916
... sounds good! But could you get a bit more specific? What is TW1 and TToolWin1Form? My tool windows are called Form2 and Form3. Is TToolWin1Form=Form2 or where are my forms specified?
And do I have to declare TW1 and TW2? Are these just variables?
And finally could you tell me the command to destroy these two windows?

thank you very much
0
 
LVL 3

Expert Comment

by:lmikle
ID: 8247934
Yes.

TToolWin1Form is your Form2 and TToolWin2Form is your Form3.

TW1 and TW2 is the variables to store pointers on those windows. The main form description must looks as:

TForm1=class(TForm)
...
private
  TW1 : TFrom2;
  TW2 : TFrom3;
...
end;

and in this case Oncreate event must be like this:

procedure TForm1.Form1Creare(Sender);
begin
 TW1 := TForm2.CreateParented(GetDesktopWindow);
 TW2 := TForm3.CreateParented(GetDesktopWindow);
end;
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Bohne
ID: 8248223
...thanks, it works now! I can create the window, and it does no longer minimize!
BUT it behaves very strang... I can't press any button on this form and I can't move it... Do you know why this is???

And can you tell my how I have to destroy it at the end?
0
 

Author Comment

by:Bohne
ID: 8252730
... it's so strange! Why can't I press any button on this form??? And why can't I move it??? When I try to pic it, it changes from active to inactive all the time...

To destroy it I use TW1.Free; rigth?
0
 
LVL 3

Accepted Solution

by:
lmikle earned 150 total points
ID: 8269824
OK.

Example:

In MainForm OnCreate:

NagForm := TNagForm.Create(Nil);
NagForm.ParentWindow := GetDesktopWindow;
NagForm.Show;

Also,

In this example property FormStyle of NagForm has fsStayOnTop value. I have 3 buttons on this NagForm and all of them work properly.

May be you must call a method from MainForm in on click event of any button on your tool window.
0
 

Author Comment

by:Bohne
ID: 8285426
... hm, the creation seems not to be the problem. Because my form behaves exactly the same with the code above! :-(

So where is the problem then? I don't know where to start searching... Perhaps my button method is incorrect when the form is created this way!
Here my onclick event:

procedure TForm3.abortclick(Sender: TObject);
begin
    Form1.abortClick(Sender);
end;

Form3 is my GetDesktopWindow. Form1, the main form, does also have a button called abort with a method abortClick. That's why they have the same name...

Does this not work like this in a GetDesktopWindow? With a normal form it works without any problems...
0
 

Author Comment

by:Bohne
ID: 8292748
WHAT?!?!? Now I found out something reeealy strange!!! When I press the GetDesktopWindow anywhere, but not the button itself. I mean I just click somewhere on the form, ButtonClick is executed!!!
But when I press the button, nothing happens!!! How can this be??????? The procedure ButtonClick is executed when I click on the form!!! :-(
0
 

Author Comment

by:Bohne
ID: 8293511
... sorry, this with the Form click was stupid! But the button is still not working! :-(

I made a small project where the button does not work. Perhaps you can have a look at it:
http://www.n.ethz.ch/student/huberret/project.zip
I included the source and the exe...

thank you
0
 

Author Comment

by:Bohne
ID: 8293515
... sorry, this with the Form click was stupid! But the button is still not working! :-(

I made a small project where the button does not work. Perhaps you can have a look at it:
http://www.n.ethz.ch/student/huberret/project.zip
I included the source and the exe...

thank you
0
 

Author Comment

by:Bohne
ID: 8293518
... sorry, this with the Form click was stupid! But the button is still not working! :-(

I made a small project where the button does not work. Perhaps you can have a look at it:
http://www.n.ethz.ch/student/huberret/project.zip
I included the source and the exe...

thank you
0

Featured Post

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.

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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