编辑:更改了问题。
有没有办法在没有冻结UI的情况下将行添加到Datagridview?
我试过了:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim t As New Threading.Thread(AddressOf CreateRows)
t.IsBackground = True
t.Start()
End Sub
Private Sub CreateRows()
If DataGridView1.InvokeRequired Then
DataGridView1.Invoke(New MethodInvoker(AddressOf CreateRows))
Else
For x = 0 To 25000
DataGridView1.Rows.Add(x)
Next
End If
End Sub