Catch an Exception thrown by another form

后端 未结 4 1509
无人及你
无人及你 2021-01-19 10:48

I\'m trying to do this:

I\'m creating another form, which in it\'s FormClosed method throws an exception, that should be caught by the main form.

Main Form:<

4条回答
  •  天涯浪人
    2021-01-19 11:17

    Why are you trying throw an exception from one form to another? "Don't throw new Exception()"

    If you are trying to let the main form know that the options form is closed you could just have a flag on the main form which is set from the options form.

提交回复
热议问题