Q

How can I catch a value from one form to another before the form closes?

I have two Windows forms opened in a mainform as mdichildren. In Form A, I have a listbox with numbers. In Form B, I want to catch the selected item of the listbox (from form A) when the user pushes a button and then closes form A. The question is, how can I catch a value from one form to another before the form is closed?
Unfortunately, you can't handle an event from one form on another form. What you'll want to do is handle the Close event on Form A and manually tell Form B about the selected item.
This was first published in May 2003

Dig deeper on Win Development Resources

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:

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close