Sunday, 28 April 2013

What is the significance of delegates. Where should they be used? what are the situations where we require them? | VB.Net Interview Questions

Delegates are used as pointer to hold the controls actually i used the delegates when there is problem in VB.Net 2005 where each control is already threaded, to use my personla thread on these control i used delegates
Private Delegate Sub dd() 
Dim d1 As New dd(AddressOf c1)
Dim t1 As New Threading.Thread(AddressOf thread1)
public sub Thread1()
r1 = 
Me.Label1.BeginInvoke(d1) 
Me.Label1.EndInvoke(r1)
end sub
Public Sub c1()
Me.Label1.Text = ct1
Me.Label1.Refresh() 
End Sub

No comments: