Docking a Form into a Panel - CSharp
This is a discussion on Docking a Form into a Panel - CSharp ; Can anyone help me please.
I want to dock a form into a panel
Basically what I would want is a Panel that IS a MDI Container or a similar
solution.
Any suggestions?
Daniel...
-
Docking a Form into a Panel
Can anyone help me please.
I want to dock a form into a panel
Basically what I would want is a Panel that IS a MDI Container or a similar
solution.
Any suggestions?
Daniel
-
Re: Docking a Form into a Panel
Daniel,
Do you have control over the forms? If so, then I would suggest that
all of the controls on the form actually go on a panel itself, then, when
you want to dock the controls, you re-parent the panel on the form to the
panel you want to dock the form to.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
"Daniel Jeffrey" <daniel_c_jeffrey@hotmail.com> wrote in message
news:OaNLydGOIHA.5208@TK2MSFTNGP04.phx.gbl...
> Can anyone help me please.
>
> I want to dock a form into a panel
>
> Basically what I would want is a Panel that IS a MDI Container or a
> similar solution.
>
> Any suggestions?
>
> Daniel
-
Re: Docking a Form into a Panel
wont the form still show then?
I am guessing you mean something like this
SimpleForm sf = new SimpleForm();
sf.Panel.Parent = this.SomePanel;
sf.Show();
?
Dan
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:738CC9D4-E488-43A0-929D-F80431E65647@microsoft.com...
> Daniel,
>
> Do you have control over the forms? If so, then I would suggest that
> all of the controls on the form actually go on a panel itself, then, when
> you want to dock the controls, you re-parent the panel on the form to the
> panel you want to dock the form to.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "Daniel Jeffrey" <daniel_c_jeffrey@hotmail.com> wrote in message
> news:OaNLydGOIHA.5208@TK2MSFTNGP04.phx.gbl...
>> Can anyone help me please.
>>
>> I want to dock a form into a panel
>>
>> Basically what I would want is a Panel that IS a MDI Container or a
>> similar solution.
>>
>> Any suggestions?
>>
>> Daniel
>
-
Re: Docking a Form into a Panel
> I want to dock a form into a panel
Unless I mis-understand your goal ...
put a Panel on a Form, but a button on the Form that when you click it does
something like this :
Form newForm = new Form();
newForm.TopLevel = false;
// size the Form, set its TitleBar attributes, FormBorderStyle or whatever
panel1.Controls.Add(newForm);
newForm.Show();
newForm.Dock = DockStyle.Top;
newForm.BringToFront();
Set the AutoScroll property of Panel to 'true and each new Form will appear
at the top of all other added Forms.
You can easily write code to minimize all these windows, or maximize them,
etc, by just using foreach on the panel1.Controls property ... assuming that
all contents of your panel are Forms.
best, Bill
Similar Threads
-
By Application Development in forum Java
Replies: 0
Last Post: 02-04-2007, 04:41 PM
-
By Application Development in forum Java
Replies: 0
Last Post: 12-05-2005, 01:49 PM
-
By Application Development in forum Java
Replies: 0
Last Post: 11-14-2004, 02:47 AM
-
By Application Development in forum Java
Replies: 0
Last Post: 09-30-2004, 02:56 AM
-
By Application Development in forum Java
Replies: 0
Last Post: 08-12-2004, 08:47 AM