I have a form that inherits from a base form. There is code both in the baseform_load and childform_load events.
The BaseForm looks like this:
public partial class BaseForm : Form { public BaseForm() { InitializeComponent(); } private void BaseForm_Load(object sender, EventArgs e) { //Do stuff... } } And a child form might look like this:
public partial class ChildForm : BaseForm { public ChildForm () { InitializeComponent(); } private void ChildForm _Load(object sender, EventArgs e) { //Do stuff... } } The baseform's load event is not explicitly loaded. The event handlers are also available because they're being created through the form designer.
I open my forms with the following method:
public static DialogResult ShowForm<T>(this Form form, bool canShowForm) where T : Form, new() { return new T().ShowDialog(form); } Everything was working fine, but all of a sudden, neither the code in the baseform nor childform load events is being called.
Note: I'm calling InitializeComponent in my childform constructor and it doesn't raise any exception.
What is wrong here?
childformcall thebaseforms load event? There isn't really enough information here to determine the cause