I have a winforms form which is inherited from another form.
e.g.
class StartForm : aSyncDialog
aSyncDialog has an onload event
protected override void OnLoad(EventArgs e)
I have noticed that the load event in StartForm is not firing but the OnLoad one is.
private void StartForm_Load(object sender, EventArgs e)
Any idea why? Is there something I need to put into either the parent or sub class to get it to run?
Make sure you call base.OnLoad(e) from your override of OnLoad in aSyncDialog
The reason for this is that the OnLoad method in the Form class raises the Load event.
When you override the OnLoad method in aSyncDialog and don’t call base.OnLoad, then the event isn’t raised, so the subclass of aSyncDialog doesn’t have any event to handle.