method called by Delegate.BeginInvoke from form load; Sometimes executes before Form.Shown

  • Thread starter Thread starter sbprasadrao
  • Start date Start date
S

sbprasadrao

Guest
Due to some logic we call methodA using Delegate.BeginInvoke from Form.Load method.

Once methodA finishes we call AsyncOperation.PostOperationCompleted to close the Form;

However sometimes Form.Shown event runs after closing the form. I see Shown event is called as BeginInvoke(new MethodInvoker(CallShownEvent));

How to guarantee method called by delete.beginInvoke executes after Form.Shown event;

Note I cannot move call to methodA using Delegate.BeginInvoke from Form.Load method.

Please advice.

Thanks

Continue reading...
 
Back
Top