0

Windows Application Form

I have a user control called 'ucForm', this 'ucForm' have a button to pop out a windows called 'pForm', I want to code it like this, when I press the 'Next' button it will close the 'pForm' and pass the textbox value in 'pForm' to 'ucForm' textbox. What code should I do in the button_click in 'pForm' and what event and method should used to detect the closing of the 'pForm' and perform passing value. Thanks

Note: I am using .net framework 2.0 and form_closing is oboslete in that.
Source: http://msdn.microsoft.com/en-us/library/system.windows.forms.form.closing.aspx

2
Contributors
2
Replies
13
Views
4 Years
Discussion Span
Last Post by taekiewzz
0

If you use the ShowDialog method, the execution stops until the form is closed.
Take a look at this thread.

Edited by tinstaafl

0

What I actually did is

private void btnContinue_Click(object sender, EventArgs e)
{
    this.Dispose();
}

and on my ucForm I check if the pForm.IsDispose() then pass the parameter.

This actually works for my case.
Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.