Module Module1
Delegate Sub StringMethod(ByVal S As String)
Sub DisplayString(ByVal S As String)
Console.WriteLine(S)
End Sub
Sub UpperString(ByVal S As String)
Console.WriteLine(UCase(S))
End Sub
Sub Main()
Dim MyMethod As New StringMethod(AddressOf DisplayString)
MyMethod.Invoke("Visual Basic .Net Programming")
MyMethod = AddressOf UpperString
MyMethod.Invoke("Visual Basic .Net Programming")
End Sub
End Module
|