Public
Delegate Sub changeIconStatusInvoker(index As Integer)
Private
WithEvents changeIconStatusWorker As System.ComponentModel.BackgroundWorker
'Cambiamos el icono en el campo
correspondiente de la fila de un datagridview (dgUsers), segun el valor del
campo status
Private Sub changeIconStatusWorkerWorker_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs)
Handles changeIconStatusWorker.DoWork
Dim d As New changeIconStatusInvoker(AddressOf
Me.changeIcon)
For i As Integer = 0 To dgUsers.RowCount - 1
Me.Invoke(d, New
Object() {i})
Next
End Sub
Function
changeIcon(index As Integer)
As Boolean
If
dgUsers("statusID", index).Value =
"1" Then
dgUsers("status", index).Value = My.Resources.chat_on
Else
dgUsers("status", index).Value = My.Resources.chat_off
End
If
Return
True
End Function