0

Hi,

Maybe this is a simple question...

I want to open a 2nd form using a load click button. I already did it:

private void loadbtt_Click(object sender, EventArgs e)
{
ScndForm.Show();
ScndForm.Update();

// Rest of the instructions for load button
}

The problem is that it is only showing the 2nd form and not waiting if it is closed or if the operation inside it had any error, it just go to the rest of the instructions in the load button section...
I want to do it without a Global Variable, should is possible?

Edited by ja0: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ja0
0

Without knowing more about what you are trying to do (Do you want Update() to run right after you show the form, or after the user is finished with the form) it's hard to help. But, if you want the user to have to deal with form two and close it (however you allow them to do that), then use ShowModal(), as in ScndForm.ShowModal(); . The code in loadbtt_Click will stop at the ShowModal() line and wait for the ScndForm to close.

0

Without knowing more about what you are trying to do (Do you want Update() to run right after you show the form, or after the user is finished with the form) it's hard to help. But, if you want the user to have to deal with form two and close it (however you allow them to do that), then use ShowModal(), as in ScndForm.ShowModal(); . The code in loadbtt_Click will stop at the ShowModal() line and wait for the ScndForm to close.

Hey that worked. Instead of using ShowModal() I used ShowDialog() because the first one was not in the options.

I want to ScndForm.Update(), after the user put some parameters in the 2nd form and for update the variables with the user content.

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.