This is a shortcut to the original trick from Antonio Lopez R: Use form as subform
I highly recommend that you read Antonio's article and understand it. I love embed common functions into extensions, because the code becomes very easy to read.
At first, I'll try this way:
static class SubFormExtensions
internal static bool AttachTo(this Form subForm, Panel panel)
if (panel == null || subForm == null) return false;
subForm.FormBorderStyle = FormBorderStyle.None;
subForm.TopLevel = false;
subForm.ShowInTaskbar = false;
subForm.Dock = DockStyle.Fill;
Using the Code
What I'm doing here is just using extensions to make things clear.
Using the same example as Antonio, you can call this way:
var SubForm = new frmReportsAndCharts();
Points of Interest
This is my first test writing an article, so feel free to point anything strange here.
2012-06-12: First version of article.