F
feng
We have a windows form project that has multiple child
forms inherit from one base form. In our base form's form
load event handler, we have some common logic in there.
These common logic is needed by all the child forms when
they load up. So when a child form gets called, the base's
form load event handler gets called first, so is the
common logic, then the child's load event handler gets
executed.
So far, everything works fine, except one: the base form's
load event handler gets executed not only at run time, but
also at the design time, when the child form is opened in
the form designer! This is so problematic, bucause we get
errors each time we open the designer. That's because a
lots of things that our common logic needs to run are not
available at the design time (of course!).
Can someone tell me if this is expected behavior? Is there
a way we can skip this execution at design time? Or any
other suggestions?
Thanks
forms inherit from one base form. In our base form's form
load event handler, we have some common logic in there.
These common logic is needed by all the child forms when
they load up. So when a child form gets called, the base's
form load event handler gets called first, so is the
common logic, then the child's load event handler gets
executed.
So far, everything works fine, except one: the base form's
load event handler gets executed not only at run time, but
also at the design time, when the child form is opened in
the form designer! This is so problematic, bucause we get
errors each time we open the designer. That's because a
lots of things that our common logic needs to run are not
available at the design time (of course!).
Can someone tell me if this is expected behavior? Is there
a way we can skip this execution at design time? Or any
other suggestions?
Thanks