Catch block not catching exception

后端 未结 4 1838
你的背包
你的背包 2020-12-09 14:17

I have a child form that is throwing an ApplicationException in the Load event handler (intentionally for testing purposes). The parent form wraps the ChildForm.Show() meth

4条回答
  •  一向
    一向 (楼主)
    2020-12-09 14:34

    I apologize for the C# (I don't know the Vb syntax)

    are you doing something like this:

      ChildForm child = new ChildForm();
      try {
          child.Show();
      }
      catch(Exception ex)
      {.....}
    

    If so, I believe the Load event would happen on the New, not the Show(); (Show would fire Activate)

提交回复
热议问题