Jens
> Is there anyone having experience in creating forms inside of a panel?
Why are you re-parenting forms to begin with? Such operations should be
limited to MDI only, which is specifically designed for that. If MDI does
not suit your needs, then what exactly are you trying to accomplish in the
first place?
Gambit
Probably you are right. I thought I could easily write my own MDI
mechanism. The main reason for this is, that I want the childs either be
separate windows or sheets of a page control. But probably this is
possible, too, with normal MDI applications, maybe using some docking
mechanism. But, well, everything works perfectly, except of this
occasional graphic errors, so I thought I could manage to get it working
with the help of someone, who has done something similar.
Jens
> The main reason for this is, that I want the childs either
> be separate windows or sheets of a page control.
You should use frames for that. You can then place the frames on forms or
sheets as needed. That is the kind of thing that frames are meant for
Gambit
What is the error?
- Brian
When a child form is visible only partial, and I increase the size of
the panel, making the child form visible completely, there are lines
(with a width of 2 pixels), which are not invalidated correctly. See
b.p.atachments (same subject). Maybe I better use a normal MDI approach,
but I think it's strange anyway (and should be possible, shouldn't it?).
Jens
I hate problems like that. They can be *very* difficult to debug.
> Maybe I better use a normal MDI approach,
> but I think it's strange anyway (and should be possible, shouldn't it?).
I built a simple test program (Delphi 6) and it works. It was fairly
MDI-ish and there were no paint remnants.
The problem could be in the paint code (how are the "child" forms
painted?), a bug in the VCL, a bug in the operating system (Windows
2000), or a problem with the video system.
- Brian
That's a good hint, so probably it's a bug I created myself. Have to
look at all the methods overridden / messages catched / events handled
for both the container and the child forms.
> The problem could be in the paint code (how are the "child" forms
> painted?), a bug in the VCL, a bug in the operating system (Windows
> 2000), or a problem with the video system.
It's the same bug on Windows 2000 and XP, tested on 3 different PCs
(with 3 different graphic cards), so I guess it must be a bug in my
code. But switching off certain things (like background painting for the
container panel) did not help, so maybe it's a combination of two or
more "features". Starting a test project (like you've done) certainly
will help.
Jens
Andrew
We did something similar, and use the following code, didn't face any
problems:
constructor TEmbeddableForm.CreateEmbeddableForm(AOwner: TComponent;
parctrl : TWinControl );
begin
if parctrl <> Nil then begin (* embedded child window *)
FParentHandle := parctrl.Handle;
BorderIcons := [] ;
BorderStyle := bsNone ;
Align := alClient ;
SetBounds ( 0, 0, parctrl.Width, parctrl.Height ) ;
inherited Create(AOwner);
end
end
Martin
Create a new Frame unit (in the File/New/Other... menu).
Copy all the controls and code (except FormCreate and Formshow) to
the new unit.
Now insert a frame control on the original form (this is a Standard
control).
Now you have a form that appears just the same as before, and you
can place the frame in a panel on a new form. Just again place a
frame control on the panel.
Very easy.
"Jens Gruschel" <nos...@thisurldoesnotexist.com> wrote in message
news:425aa47b$1...@newsgroups.borland.com...
so I have a few panels say Left Top and Bottom
when I click on the Button in my left Panel, I want my Tframe1 created/or
shown in my Top Panel
so, I don't want to see the frame on my screen while I am working on it,
since that panel will be used for other screens/setting to show.
"Martin B" <m...@mb.com> wrote in message
news:426c...@newsgroups.borland.com...