By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,117 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,117 IT Pros & Developers. It's quick & easy.

Embedding form in a panel to allow form in non-child window area

P: n/a
Hi,

I have an MDI application, in which I want to embed one form
(System.Windows.Forms.Form) into a specified area of my MDI application.
This is, wihtout affecting the capability of other child forms opening.

Currently, I'm achieving this by...
1) place a panel on an mdi container form, setting its Dock to Top
2) have following code to embed a form into this panel (crazy, ha?)

// FormToEmbed is of type System.Windows.Forms.Form
FormToEmbed form = new FormToEmbed;
form.FormBorderStyle = FormBorderStyle.None;
form.MaximizeBox = false;
form.MinimizeBox = false;
form.ControlBox = false;
form.MdiParent = this;
form.Parent = this.panel1
form.Show();

I have a strong feeling that this is too crude... is there any better way
that you suggest?
These days many programs like Visual Studio .NET IDE, have a docking window
or tabbed window, but I wonder what's the trick behind that?

Would appreciate any input suggestions you may.

thanks!
-Yasutaka

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The code I gave run, though...
I'll still give a try of the way you suggested.

But, isn't there better way than to embed in panel?

thanks!
-Yasutaka

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
* "Yasutaka Ito" <no****@nonexistent.com> scripsit:
I have an MDI application, in which I want to embed one form
(System.Windows.Forms.Form) into a specified area of my MDI application.
This is, wihtout affecting the capability of other child forms opening.

Currently, I'm achieving this by...
1) place a panel on an mdi container form, setting its Dock to Top
2) have following code to embed a form into this panel (crazy, ha?)

// FormToEmbed is of type System.Windows.Forms.Form
FormToEmbed form = new FormToEmbed;
form.FormBorderStyle = FormBorderStyle.None;
form.MaximizeBox = false;
form.MinimizeBox = false;
form.ControlBox = false;
form.MdiParent = this;
form.Parent = this.panel1
form.Show();

I have a strong feeling that this is too crude... is there any better way that you suggest?


You cannot embed an MDI child in a panel on the MDI parent. You can set
the form's 'TopLevel' property to false and then add it to the panel's
'Controls' collection.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.