D
**Developer**
I have a Form (FV&C) containing a userconrtrol (CF&E)
I do a ShowDialog for the form and the form's Load calls a method of the
UserControl.
The first time I do this the usercontrol appears on the form as I'd expect
after the method had been run.
The second time I do this the usercontrol appears on the form as if the
usercontrols Load had last been run.
I peppered the code with writes and the following resulted.
Note that for the fist time, the usercontrol's Load runs before the form's
Load starts.
But, notice at the bottom of the list that for the second time, the
usercontrol's Load runs after the form's Load ends.
Does this make sense to you?
Any suggestions as to what is going on?
I need to have the CF&E Load run before the called method or better, if the
usercontrol remember from the last time, not to run at all.
Thanks
FV&C New Staring
CF&E New Staring
CF&E New Ending
FV&C New Ending
Call FV&C method
FV&C.ShowDialog
CF&E Load Staring
CF&E Load Ending
FV&C Load Staring
Called a method in CF&E
FV&C Load Ending
FV&C Closing
FV&C.ShowDialog Returned
Call FV&C method
FV&C.ShowDialog
FV&C Load Staring
Called a method in CF&E
FV&C Load Ending
CF&E Load Staring
CF&E Load Ending
FV&C Closing
FV&C.ShowDialog Returned
I do a ShowDialog for the form and the form's Load calls a method of the
UserControl.
The first time I do this the usercontrol appears on the form as I'd expect
after the method had been run.
The second time I do this the usercontrol appears on the form as if the
usercontrols Load had last been run.
I peppered the code with writes and the following resulted.
Note that for the fist time, the usercontrol's Load runs before the form's
Load starts.
But, notice at the bottom of the list that for the second time, the
usercontrol's Load runs after the form's Load ends.
Does this make sense to you?
Any suggestions as to what is going on?
I need to have the CF&E Load run before the called method or better, if the
usercontrol remember from the last time, not to run at all.
Thanks
FV&C New Staring
CF&E New Staring
CF&E New Ending
FV&C New Ending
Call FV&C method
FV&C.ShowDialog
CF&E Load Staring
CF&E Load Ending
FV&C Load Staring
Called a method in CF&E
FV&C Load Ending
FV&C Closing
FV&C.ShowDialog Returned
Call FV&C method
FV&C.ShowDialog
FV&C Load Staring
Called a method in CF&E
FV&C Load Ending
CF&E Load Staring
CF&E Load Ending
FV&C Closing
FV&C.ShowDialog Returned