VB中从线程更新DataGridView遇问题,已尝试两种方法
VB线程中更新DataGridView失败问题
我尝试通过VB在线程中更新DataGridView,但以下两种方法均未成功:
第一种方法代码
If Control.InvokeRequired Then Control.Invoke(Sub() Control.Rows.Add(Event*Date, Event*Details)) End If
第二种方法代码
If Control.InvokeRequired Then Control.Invoke(New Addrow(AddressOf Form1.AddToDatatable), New Object() {Data_row}) End If
相关委托与方法定义
Public Delegate Sub Addrow(ByVal Data_row As DataRow) Public Sub AddToDatatable(ByVal Data_row As DataRow) Data_table.Rows.Add(Data_row) Daily_Log.Refresh() End Sub
内容的提问来源于stack exchange,提问作者Iain
相关产品推荐
相关产品推荐

