winforms: updating progress with a parallel.foreach
问题 I haven't seen any posts pertaining to my issue, so I apologize if I post a question already asked. I have a windows form program, c#, that checks stocks and does analysis. The main form launches another form, via a new thread and ShowDialog. While it's loading, it's running a parallel.foreach. In that parallel.foreach, I'd like to show progress on the main form. I've run into cross-threading issues, and added invoke, although it doesn't appear to be thread-safe as it seems to be deadlocking