I would set up a property on myForm1 and have myForm2 access
the property to set it.
As for the first part, you might want to consider adding a
constructor to your myForm2 that accepts a string, and pass
that value in instead of using it as a property. This makes
it more obvious if anybody else ever uses your form, that the
value needs to be (or can be) set when creating the form.
Robin S.
-----------------------------
> In a windows form application created in VS 2005 VB.Net I have one
> form
[quoted text clipped - 8 lines]
> How can I return a value back from myForm2 back to myForm1 where the
> above code is located on a button click event?
ClayB - 26 Jan 2007 10:14 GMT
Another solution is to declare aValue as a public member of Form2. Then
within Form1, you can directly reference x.aValue (provided you keep a
reference to x in scope).
================
Clay Burch
Syncfusion, Inc.
robin9876@hotmail.com - 26 Jan 2007 11:11 GMT
I ended up doing that by using the showdialog option from the call in
form1 to keep the form in scope until after form2 was closed.
> Another solution is to declare aValue as a public member of Form2. Then
> within Form1, you can directly reference x.aValue (provided you keep a
[quoted text clipped - 3 lines]
> Clay Burch
> Syncfusion, Inc.