Torna al Thread

Public Class Form1 Private Delegate Sub DGV_AddRow_DELEGATE(ByVal STR As String) Dim WithEvents skt As New Socket Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Th As New Threading.Thread(AddressOf skt.Start) Th.Start() End Sub Public Sub DGV_AddRow(ByVal STR As String) If Me.InvokeRequired Then Dim d As New DGV_AddRow_DELEGATE(AddressOf DGV_AddRow) Me.Invoke(d, STR) Return End If DataGridView1.Rows.Add(STR) End Sub End Class
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5