VB.net Program to Demonstrate a Simple Delegate With Non-member Function

You are currently viewing VB.net Program to Demonstrate a Simple Delegate With Non-member Function

VB.Net program to demonstrate a simple delegate with non-member function

'VB.net program to demonstrate a simple delegate 
'with non-member function.

Module Module1
    Public Delegate Sub MyDelegate()
    Sub SayHello()
        Console.WriteLine("Hello World")
    End Sub

    Sub Main()
        Dim del As MyDelegate = AddressOf SayHello
        del()
    End Sub
End Module
Hello World
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply