Passing Variables between forms

ejarju

New member
Joined
Oct 18, 2005
Messages
2
Location
Glasgow
Programming Experience
Beginner
Hi I am new to VB. I need to pass the contents of variables defined in the code of one form to another control text property in another form. I am using this:

Public Shared varTest as string
:
:
:
vartest="This is a test"


in the code of the new form opened as a child form,

I have this:

rdotest.text= vartest

but does not recognize the variable vartest- it cannot see its declaration in the parent form. Can someone help? Thanks

Edi
 
Hello ejarju, look into using modules in your applications;

VB.NET:
Module MyModule
Public vartest As string
vartest = "..."
End Module

I think thats right ;)
 
Back
Top