Board index » delphi » Form Display

Form Display


2005-05-20 02:15:58 PM
delphi122
Hi,
I have a main form, with a menu and a bottom panel showing information. When
I click a menu command I want a diffirent form to show/activate. How do I do
this? I am coding in Delphi 8. I used LMD Components in Delphi 7 and they had
a form display component where you could add/remove (display) forms.
Any help will be apreciated.
Thanks.
 
 

Re:Form Display

Jean Botes writes:
Quote

I have a main form, with a menu and a bottom panel showing information. When
I click a menu command I want a diffirent form to show/activate. How do I do
this? I am coding in Delphi 8. I used LMD Components in Delphi 7 and they had
a form display component where you could add/remove (display) forms.
Well first off, you do NOT give us much information.
Thus, I will have to assume you are asking the basics of Window showing.
Now, is this different form in the AutoCreate list,
(Found out by the Delphi Menu Item: Project - Options - Forms (Tab).
If it is then (and assuming it is called Form2), you can just do:
Form2.Show;
or
Form2.ShowModal; // If you want Form1 to suspend.
If it is NOT in the autocreate list then need to do:
Application.CreateForm(TForm2,Form2);
Form2.ShowModal;
Form2.Free;
If you do NOT want a modal Form2 then need to:
Application.CreateForm(TForm2,Form2);
Form2.Show;
Then in Form2 code, in the onclose event add:
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action= caFree;
end;
--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia
 

Re:Form Display

Hi Charles,
I want to achieve the same as this component can help me do. But I don't
want to use the LMD Components, I want to do it with Delphi 8.
Thanks for your quick responce!
Jean.
__________________
Component:
LMDFormDisplay
Description
This small but very useful component is able to display a form like a panel
within the component. The reworked LMDMEGADEMO project demonstrates this:
The four main pages are not included in a TNotebook but are available as
ordinary forms (check units LMDPage1 to LMDPage4). If you check the
sourcecode these forms are only created if required and removed if another
page becomes active. This is not only useful for faster loading of the
mainform but also much more resource friendly than using a TNotebook.
Besides the forms are much easier reusable in other projects.
__________________
"Charles Hacker" <XXXX@XXXXX.COM>writes
Quote
Jean Botes writes:
>
>I have a main form, with a menu and a bottom panel showing information.
When
>I click a menu command I want a diffirent form to show/activate. How do
I do
>this? I am coding in Delphi 8. I used LMD Components in Delphi 7 and they
had
>a form display component where you could add/remove (display) forms.

Well first off, you do NOT give us much information.
Thus, I will have to assume you are asking the basics of Window showing.


Now, is this different form in the AutoCreate list,
(Found out by the Delphi Menu Item: Project - Options - Forms (Tab).

If it is then (and assuming it is called Form2), you can just do:
Form2.Show;
or
Form2.ShowModal; // If you want Form1 to suspend.


If it is NOT in the autocreate list then need to do:

Application.CreateForm(TForm2,Form2);
Form2.ShowModal;
Form2.Free;

If you do NOT want a modal Form2 then need to:
Application.CreateForm(TForm2,Form2);
Form2.Show;

Then in Form2 code, in the onclose event add:

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action= caFree;
end;


--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia