Saturday 28 January 2012

How to use functions in vb.net?


How to use functions in vb.net?
We can use functions for return the value in function block into main block of code. This tutorial shows how to use the functions in vb.net?
Step1:
Open Microsoft visual studio
Step2:
Select file newàwindows form application à rename it as functions
Step3:
Drag and drop the button, label
Step4:
Double click the button and write the code
Code:
Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click

        Label1.Text = callthefunction()

    End Sub

    Private Functioncallthefunction()

        callthefunction = "your so...cool"

    End Function

End Class
  Output:


No comments:

Post a Comment