xZerox
xZerox

Reputation: 331

VB.net Module returning data like a function

How could I call a module or something else to return data to me after its ran. I don't want to make my form1 code all messy.

Thanks!

Example by what I mean return:

Public Function Test() As String
    Return "Tes34t"
End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    MessageBox.Show(Test)
End Sub

Upvotes: 0

Views: 2109

Answers (1)

John Saunders
John Saunders

Reputation: 161831

If Test is in the same class (Form1), then just use

MessageBox.Show(Test())

If it's in module "MyModule", then use

MessageBox.Show(MyModule.Test())

Upvotes: 1

Related Questions