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 last 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.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close