I want to call a method when an animation ends. I'm using this statement:
AddHandler anim.Completed, AddressOf anim_completed
But i want the anim_completed sub to be with parameters. Any ideas how to do that?
I want to call a method when an animation ends. I'm using this statement:
AddHandler anim.Completed, AddressOf anim_completed
But i want the anim_completed sub to be with parameters. Any ideas how to do that?
Simple solution. Use Anonymous Event Handler, then you will be able to access Ellipse object directly.
Dim target As Ellipse = Nothing
AddHandler anim.Completed, Sub()
If target IsNot Nothing Then
End If
End Sub
Your delegate/method need to have the same signature as the event. But inside that event you can call what ever you want.
AddHandler anim.Completed, AddressOf onAnimCompleted
Sub onAnimCompleted(sender As Object, e As EventArgs)
Dim target As New Ellipse
anim_completed(target)
End Sub