I deleted my previous answer as it was absolute rubbish. You're 100% correct, there's no Load event for the CF. Turns out I discovered this myself when I wrote my UserControl. I looked for the load event on an old project, in which all my user controls are inheriting from my own base class... called UserControlBase.
I appear to have implemented my own Load functionality within my base class. This is a cut down version of my base class:
public class UserControlBase : UserControl
{
public UserControlBase() { }
public event EventHandler Load;
private void Loaded()
{
if (this.Load != null)
{
this.Load(this, new EventArgs());
}
}
public new void ResumeLayout()
{
this.Loaded();
base.ResumeLayout();
}
public new void ResumeLayout(bool performLayout)
{
this.Loaded();
base.ResumeLayout(performLayout);
}
}
Now, in your actual user control, do the following:
public partial class UserControl1 : UserControlBase
{
public UserControl1()
{
InitializeComponent();
}
private void UserControl1_Load(object sender, EventArgs e)
{
}
}
This is from a very old project. In later projects I tend to just have a .Load()
method on user controls that is called in the Form_Load
.