Home > DeveloperSection > Forums > How to create Function in vb.net
Ankit Singh

Total Post:341

Points:2389
Posted on    December-22-2015 10:14 PM

 .NET VB.Net 
Ratings:


 1 Reply(s)
 275  View(s)
Rate this:
I want to use function in vb.net .please help me.


aditya kumar Patel

Total Post:250

Points:1782
Posted on    December-22-2015 10:16 PM

 A Function returns a value. It uses a special syntax form in the VB.NET language. The Function optionally accepts one or more parameters—these are called formal parameters.

Module Module1
    Function Area(ByVal radius As Double) As Double
        Return Math.PI * Math.Pow(radius, 2)
    End Function

    Sub Main()
        Dim a As Double = Area(4.0)
        Console.WriteLine(a)
        Console.Read()
    End Sub

End Module


Modified On Jan-27-2016 06:13:33 AM

Don't want to miss updates? Please click the below button!

Follow MindStick