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

Total Post:341

Posted on    December-22-2015 10:14 PM

 .NET VB.Net 

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

aditya kumar Patel

Total Post:254

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)
    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