﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » How to place a form inside a panel</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 11 Sep 2026 21:56:30 GMT</lastBuildDate><ttl>20</ttl><item><title>How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27700.aspx</link><description>I have a main form which has a menu on it and menu items call various forms. When the called form displays, it can display on top of the menu. How do I avoid this. Probaly a panel is the solution as a placeholder but am not sure how to place the called from into the panel. Also, does this have any implication for MDI forms .</description><pubDate>Wed, 21 Jul 2010 11:12:21 GMT</pubDate><dc:creator>Ger Cannoll</dc:creator></item><item><title>RE: How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27713.aspx</link><description>Yep, that's the it!  Glad your getting it going!</description><pubDate>Wed, 21 Jul 2010 11:12:21 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27711.aspx</link><description>ok. Did a bot of digging around and can now add the form to a panel:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;themedPanel1.Controls.Add(smaForm);&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 21 Jul 2010 05:44:19 GMT</pubDate><dc:creator>Ger Cannoll</dc:creator></item><item><title>RE: How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27710.aspx</link><description>Hi. Thanks for all your replies. I am having difficulty 'adding' my form to the panel. I thought &amp;nbsp;I could do something like:&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;[codesnippet]this.themedPanel1.Add(mycalledForm);[/codesnippet]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;but there is not an Add method for themedPanel1 that I can see at least. &amp;nbsp;Is there another way of doing this&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 21 Jul 2010 05:39:18 GMT</pubDate><dc:creator>Ger Cannoll</dc:creator></item><item><title>RE: How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27705.aspx</link><description>As Edhy stated, an MDI setup is also valid. Not sure which is what you want, but now you have options. :D</description><pubDate>Tue, 20 Jul 2010 16:11:25 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27704.aspx</link><description>You'll have to experiment with this, but you should be able to do this via code. I.e. something like this:&lt;br&gt;
&lt;br&gt;
[codesnippet]//-- Instantiate form, set it to be NOT top level.&lt;br&gt;
MyChildForm frm = new MyChildForm();&lt;br&gt;
frm.TopLevel = false;&lt;br&gt;
&lt;br&gt;
//-- Add this to the form's collection of controls.&lt;br&gt;
this.Controls.Add(frm);&lt;br&gt;
&lt;br&gt;
//-- You still have to call show...&lt;br&gt;
frm.Show();[/codesnippet]&lt;br&gt;
&lt;br&gt;
A couple of things to note: &lt;br&gt;
- You have to set the TopLevel property to false, otherwise you'll get a "Top-level control can't be added to a control" exception.&lt;br&gt;
- You must also show the added form, or you won't see anything.&lt;br&gt;
- You can add it to other containers. E.g. a panel, a splitter control's panel, etc.&lt;br&gt;
- The form will be movable and sizable if configured.&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 20 Jul 2010 16:09:21 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: How to place a form inside a panel</title><link>http://forum.strataframe.net/FindPost27703.aspx</link><description>Hi Gerard,&lt;br&gt;
&lt;br&gt;
I believe your main form need to be an MDI and then each form will be a child of the MDI form.  &lt;br&gt;
&lt;br&gt;
Trent has posted some sample on how to create your own MDI form here, just look in the forum for "MDI".  Also the StrataFlix sample have some code on how to create your own MDI form and how to call your other forms and make them child of the MDI parent.</description><pubDate>Tue, 20 Jul 2010 15:44:10 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>