Solved

Form inside MainForm

Posted on 1998-11-28
9
209 Views
Last Modified: 2010-04-04
My application consists of one main form and couple of other forms. I am wondering if it is possible to keep all forms created inside the client area of the main form so that if I minimize or move the main form, all other opened form will still be kept inside the main form's client area.

Any idea will be appreciated !

Raymond
0
Comment
Question by:chan3898
[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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1348279
hi chan3898,

make a mdi-application. See delphi examples.

meikl
0
 

Author Comment

by:chan3898
ID: 1348280
Is there other possible way beside using MDI-application.
0
 
LVL 3

Accepted Solution

by:
Matvey earned 50 total points
ID: 1348281
Of course! Just make the other forms' parent the main form. I already tried this - what you get is simply windows drawn inside the main window, with tha ability to drag and close, and you can operate on it like any other window. Hope this is better for you than an MDI application...

--Matvey
0
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.

 

Expert Comment

by:Aleq
ID: 1348282
Only hook a wm_move message a move windows when the main one has been moved....
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1348283
BTW, this way you can make your form to be a parent even for a window from a different application, the Windows Explorer for example, or anything else, using the SetParent API.
0
 

Author Comment

by:chan3898
ID: 1348284
I have tested your suggestion by making a new application with two forms (Form1 and Form2).  Form2 will be created using the following statement :
   Form2 := TForm2.create(Self);   // inside Form1's

However, Form2 doesn't move when I move Form1 around the screen.

Any more suggestion ?

Thank you !
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1348285
hi chan3898,

try this

procedure TForm1.FormCreate(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
  Form2.Parent := Form1;
  Form2.show;
end;

meikl
0
 

Author Comment

by:chan3898
ID: 1348286
Thank you, I have got what I want.
0
 

Author Comment

by:chan3898
ID: 1348287
Thank you, I have got what I want.
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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month7 days, 15 hours left to enroll

617 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