Running a windows form in a separate thread

前端 未结 4 1388
孤独总比滥情好
孤独总比滥情好 2021-01-15 02:10

I am dealing with running a control in a form, however the form itself is of no value to me. I essentially want the form to run a task and return a value, however for that I

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-15 02:41

    Why are you running tasks in a form?

    This sounds like you have your UI and program logic tightly integrated. This is bad design.

    In general, You can get data from a worker thread the standard way. Worker stores data in a thread safe data structure, then sends an event to the main thread signaling the data is available.

提交回复
热议问题