You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 16:55:26