Quote:
A sub and a function are both subroutines, or sections of code that can be called in the program. The difference between them is that a function has a return value and a sub does not.
refer:
Difference between Private Sub, Function and Class[
^]
when you click calculate button it will fire the btnCalculate_Click event and inside that event your function(CalculateFutureValue) called with parameters and returned value will assign to
futureValue
Dim futureValue As Decimal = Me.CalculateFutureValue(monthlyInvestment,yearlyInterestRate, years)