Q

Creating a relationship between control values in two forms

How can I create a relationship between control values in two forms, such as get the combobox.selectedindex from form1 to the textbox.text in form2? If possible, how would you recommend I approach this issue?
It depends on the relationship between the two forms. If form 1 created form 2 then I would use a property on form 2 and set the property before showing the form.

It form 1 and form 2 are created as independent forms, I would use a delegate (event handler) so when form 2 wanted the value from form 1, it could fire an event on form 1 to retrieve the data and/or an event on form 2 could be fired by form 1 when the value changed.
This was first published in December 2004

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close