Get values of one form to another

indraja

New member
Joined
Jun 18, 2007
Messages
3
Programming Experience
Beginner
Hi Every one,

Iam working on VB.Net windows application.I want to get the values of one form to another form and use the value.They are not MDI forms.

Thnx in Advance.
 
you could use global parameters...

set up a new module called modParameters. In here use

VB.NET:
Module modParameters

Friend [B]parametername[/B] As [B]whatever[/B]

End Module

i.e.

Friend strUsername As String

Friend intUserAge As Integer

Friend dtDateOfBirth As Date


on form1 you just set the parameter, strUsername = me.textbox1.text

on form2, you access it simply by me.textbox2.text = strUsername


this is how I do it. Each to their own, there is always pros and cons to using whatever way, and using global parameters definately does have pros and cons - there's a thread on here somewhere if you search for "global parameters".

Hope that helps
 
Or you could keep what regards the class within the class in good OOP spirit and define a Property for users to access.
 
Back
Top