How do I safely populate with data and Refresh() a DataGridView in a multi-threaded application?

前端 未结 3 531
野的像风
野的像风 2021-02-06 16:42

My app has a DataGridView object and a List of type MousePos. MousePos is a custom class that holds mouse X,Y coordinates (of type \"Point\") and a running count of this positio

3条回答
  •  清酒与你
    2021-02-06 17:14

    You have to update the grid on the main UI thread, like all the other controls. See control.Invoke or Control.BeginInvoke.

提交回复
热议问题