Ask the Expert

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

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: