34,333
edits
Changes
→Passing Parameters to Functions and Subroutines
End Sub
</pre>
Just for the sake of completeness, change the Button control event procedure to pass through a string (note that we will change this later to pass the result of the actual calculation):
<pre>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
DisplayResult("10")
End Sub
</pre>
Press '''F5''' to build and run the application. The message window should now display 'Result is 10'.
== Defining Visual Basic Functions ==