Form inside MainForm

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
chan3898Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
MatveyConnect With a Mentor Commented:
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
 
kretzschmarCommented:
hi chan3898,

make a mdi-application. See delphi examples.

meikl
0
 
chan3898Author Commented:
Is there other possible way beside using MDI-application.
0
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.

 
AleqCommented:
Only hook a wm_move message a move windows when the main one has been moved....
0
 
MatveyCommented:
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
 
chan3898Author Commented:
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
 
kretzschmarCommented:
hi chan3898,

try this

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

meikl
0
 
chan3898Author Commented:
Thank you, I have got what I want.
0
 
chan3898Author Commented:
Thank you, I have got what I want.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.