How to read combobox from a thread other than the thread it was created on?

前端 未结 4 2016
眼角桃花
眼角桃花 2020-12-25 11:43

I am trying to read a combobox.Text from a thread other than the thread it was created on but I am getting the error:

An unhandled exception of type

4条回答
  •  攒了一身酷
    2020-12-25 12:37

    The easiest solution is to use the BackgroundWorker class to execute work on another thread, while still being able to update the UI (e.g. when reporting progress or when the task has completed).

提交回复
热议问题