Isn't the use of delegates to help with some asynchronous cases? I tried the following but my UI still hangs. When on earth do you use delegates?
Public Class Form1
Private Delegate Sub testDelegate()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Dim d As testDelegate = New testDelegate(AddressOf Add)
d.Invoke()
End Sub
Private Sub Add()
For i As Integer = 0 To 10000
TextBox1.Text = i + 1
Next
End Sub
End Class
Here's what I sent to a coworker:
Basically delegates can be used for Callbacks, Events and Asynchronous processing.
Here’s some sample code, copy and paste each example to a new command line project.
.