Board index » delphi » edit on form

edit on form


2008-04-17 11:09:52 PM
delphi96
Hi All,
If I place an edit component on a form and show this form with a button
press, like this
// hide all forms
form1.Hide;
form2.Hide;
form3.Hide;
form4.Hide;
form5.Hide;
form1.Parent := FMain.ClientPanel;
form1.Show;
The form appears as I expected but the edit components are not functioning.
As if enable is switch off. All other components are working.
I have this problem with version 2006 and 2007 Enterprise on both XP and
Vista.
Any ideas?
Thanks in advance
 
 

Re:edit on form

Quote
form1.Parent := FMain.ClientPanel;
form1.Show;
Should work.
How about
Form1.Visible := True;
Gerrit Beuze
ModelMaker Tools
 

Re:edit on form

"Peter Herijgers" <XXXX@XXXXX.COM>writes
Quote
form1.Parent := FMain.ClientPanel;
You should not embed TForm objects inside of other components like that. I
strongly suggest that you use a TFrame instead. It is designed for that.
Gambit
 

Re:edit on form

Peter Herijgers writes:
Quote
Hi All,

If I place an edit component on a form and show this form with a
button press, like this

// hide all forms
form1.Hide;
form2.Hide;
form3.Hide;
form4.Hide;
form5.Hide;

form1.Parent := FMain.ClientPanel;
form1.Show;

The form appears as I expected but the edit components are not
functioning. As if enable is switch off. All other components are
working.

I have this problem with version 2006 and 2007 Enterprise on both XP
and Vista.

Any ideas?
Your form have to use BorderStyle = bsNone, Windows does not like
caption bars on child windows and what you see is a symptom of this
dislike.
--
Peter Below (TeamB)
Don't be a vampire (slash7.com/pages/vampires),
use the newsgroup archives :
www.tamaracka.com/search.htm
groups.google.com
 

Re:edit on form

Quote
Your form have to use BorderStyle = bsNone, Windows does not like
caption bars on child windows and what you see is a symptom of this
dislike.


--
Peter Below (TeamB)
Don't be a vampire (slash7.com/pages/vampires),
use the newsgroup archives :
www.tamaracka.com/search.htm
groups.google.com
Thanks.
Setting the BorderStyle to bsNone solved the problem.
My mistake to post this question to the graphics group.
My intension was to post it to the vcl.components.using.win32 group.
 

Re:edit on form

Hi Remy,
As Peter Herijgers wrote, its wrong place to post this message but,
I have an huge app which consists of 150-200 TForms. 1 month earlier, we
changed the design. Now we have a one main form and a menu created from tree
list at the left. When click the tree items, we change the form embedded to
panel. Up to now, it worked well. What may the problem? I do it like this;
While showing;
f_company_description:=Tf_company_description.Create(Application);
f_company_description.Parent:=pnl_all;
f_company_description.Align:=alClient;
f_company_description.BorderStyle:=bsNone;
f_company_description.Show;
And hiding
f_company_description.Release;
regards.
"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes
Quote

"Peter Herijgers" <XXXX@XXXXX.COM>writes
news:48076865$XXXX@XXXXX.COM...

>form1.Parent := FMain.ClientPanel;

You should not embed TForm objects inside of other components like that.
I strongly suggest that you use a TFrame instead. It is designed for
that.


Gambit

 

Re:edit on form

"Doni Devito" <XXXX@XXXXX.COM>writes
Quote
As Peter Herijgers wrote, its wrong place to post this message but,
I have an huge app which consists of 150-200 TForms. 1 month
earlier, we changed the design. Now we have a one main form and
a menu created from tree list at the left. When click the tree items,
we change the form embedded to panel. Up to now, it worked well.
What may the problem? I do it like this;
As I told Peter, you should be using TFrame objects for that kind of UI
instead of embedded TForm objects.
Gambit
 

Re:edit on form

Quote
You should not embed TForm objects inside of other components like that. I strongly suggest that you use a TFrame instead. It is
designed for that.
Well, you may have different experiences, but I have been using this (embedding forms
on other forms) since D1 without problems. And also Borland themselves do it inside
the IDE:
For example: captured from Delphi 7 , with " ->" meaning "inherits from"
MessageView: TMessageViewForm ->TDockableForm ->TDesktopForm ->TForm
CodeExplorer: TPasModExpForm ->TBaseModExpForm ->TDockableForm ->TDesktopForm ->TForm
Bascially all IDE views are forms.
I have on the other hand, several problems with frames on forms :-)
Nothing that could not be solved though.
Gerrit Beuze
ModelMaker Tools
Boost your productivity in the Delphi IDE with ModelMaker Code Explorer:
www.modelmakertools.com/code-explorer/index.html
 

Re:edit on form

Doni Devito writes:
Quote
Hi Remy,
As Peter Herijgers wrote, its wrong place to post this message but,
I have an huge app which consists of 150-200 TForms. 1 month earlier,
we changed the design. Now we have a one main form and a menu created
from tree list at the left. When click the tree items, we change the
form embedded to panel. Up to now, it worked well. What may the
problem? I do it like this;

While showing;

f_company_description:=Tf_company_description.Create(Application);
f_company_description.Parent:=pnl_all;
f_company_description.Align:=alClient;
f_company_description.BorderStyle:=bsNone;
f_company_description.Show;
And hiding
f_company_description.Release;
What you need to be aware of is that forms parented to a container do
not work quite like they do when used without a parent. A number of the
forms events, like the OnKey and OnActivate events, will no longer fire.
--
Peter Below (TeamB)
Don't be a vampire (slash7.com/pages/vampires),
use the newsgroup archives :
www.tamaracka.com/search.htm
groups.google.com