A few thoughts:
Form is a class like any other class. You pass values through
properties like you would any other class.
I recommend that you separate your values from the user
interface instead of trying to access them from the controls.
In other words: When the childform class is asked to close,
clientform should grab the values from its controls and store
them in private members, accessible through properties.
One childform has closed, parentform can access the values
through those properties.
For a simple scenario like this, I would suggest that this is the
way to go.
For more complex scenarios where multiple objects need to
react to changes in one or more values, the idea of subscribing
to events has some validity (but do keep track of what object
initiated a change and what objects should just reflect the change).
VB2005 and later supports the VB6 concept of a shared default
instance of a form. I have my reservations about this. I like to
know/control whether a form is freshly initialized or reused.
When/if using ShowDialog to display the form, remember to use
..DialogResult = ... to close it instead of Me.Close.
Regards,
Joergen Bech
On Tue, 27 May 2008 01:34:39 -0400, "Rob" <ro***@yahoo.comwrote:
>I have a control (Button) on a Parent form which opens a Windows form... all
I want to do is pass a value from the child form back to the parent... it
should be so simple... i.e.
ParentFormName.Textbox1.text=ChildFormName.TextBo xWhatEver.Text... but
nothing like this works.
Any ideas ?