Create properties in Form2 corresponding to the data that needs returned.
So if you had two textboxes, tbFirstName & tbLastName and you needed to
return those values, create two properties in form2 FirstName , LastName.
Then, set them when the user exits the control or when the form closes or
whatever point you want.
'Within form1
Dim f as new Form2
f.ShowDialog ' or show
'Now, set the properties in form2 as appropriate
Dim FirstNameString as String = f.FirstName
Dim LastNameString as String = f.LastName
I've got a few other examples in the compact framework forums at
www.devbuzz.com that might be helpful (but essentially they are just
derivations of this.) You could also create a module in VB.NET or a
singleton class, in C#, set the values when you exit the form and view them
from anywhere in the app since the singleton or the module will have project
level scope (or you could use a class with Shared members - all get the
same result).
HTH,
Bill
Kempton said:
I am using VB .net to wirte a application in which form1 has to call
form2.show and get the data inputed by user in form2 when form2 unload. What
should I do?