A
A
Arthur Grand2019-09-09 18:15:55
C++ / C#
Arthur Grand, 2019-09-09 18:15:55

How can I make sure that only the window with the problem closes when an exception occurs, and not the entire application?

I recently started working with c#, so I still don't understand much.
I created the main form, from which I launch both regular synchronous tasks and background Tasks with buttons. They all use third-party client methods, which can throw exceptions. How can I make it so that in the event of a problem, Tasks would simply stop, notifying me, and the windows would close without dropping the main window?
And ideally, what would Task and restart themselves.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2019-09-09
@artygrand

try-catch, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question