all groups > dotnet windows forms > april 2006 >
You're in the

dotnet windows forms

group:

Form on Panel not Anchoring/Resizing


Form on Panel not Anchoring/Resizing Smidge Boyter
4/29/2006 1:17:52 PM
dotnet windows forms:
I have a MDI Child form with various controls and a panel. On the panel at
runtime I am adding a form to the panel. Everything works except when the
outer form is resized, the panel gets resized but the form on the panel
doesn't. It just stays in the same place that it starts out on. Below is
my code that is adding the form to the panel.

Any ideas?

mfrmProdSearch = new frmProductSearch();
mfrmProdSearch.TopLevel=false;
mfrmProdSearch.FormBorderStyle = FormBorderStyle.None;
mfrmProdSearch.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
mfrmProdSearch.Anchor = System.Windows.Forms.AnchorStyles.Top;
mfrmProdSearch.Anchor = System.Windows.Forms.AnchorStyles.Right;
mfrmProdSearch.Anchor = System.Windows.Forms.AnchorStyles.Left;
pnlMLProducts.Controls.Add(mfrmProdSearch);
mfrmProdSearch.Show();

Re: Form on Panel not Anchoring/Resizing Herfried K. Wagner [MVP]
4/29/2006 8:49:28 PM
"Smidge Boyter" <jzickgraf@eskyesolutions.com> schrieb:
[quoted text, click to view]

I strongly recommend to use user controls ("Project" -> "Add user
control...") instead of embedded forms.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
AddThis Social Bookmark Button