Solved

Form inside MainForm

Posted on 1998-11-28
9
207 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
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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