Hi,
So I created a windows application that collects various pieces of information. The user is required to enter all of the information requested on the form before submitting it. The form itself works fine, as does the pop up that informs the user he/she missed entering some information.
The problem that I'm running into occurs after the pop up comes up. The user clicks "ok" to make the pop up go away, and is returned to the original form. However, when the user clicks "submit" again, after correcting the error, nothing happens. How do I return to the top of the method without losing any information in the form.
This is the code I have so far:
private void submit_button_Click(object sender, EventArgs e) |
{ |
//checks to make sure radio button fields |
//and check mark fields have a value |
|
//second form declaration |
info_warning warned = new info_warning(); |
|
variable_1 = variable_2 = variable_3 = false; |
this.get_text(); |
this.get_check_values(); |
|
if (variable_1 != null) |
var_1_selected = true; |
if (variable_2 != null) |
var_2_selected = true; |
if (variable_3 != null) |
var_3_selected = true; |
|
//creates pop up notification if any |
//radio button fields are missing |
if (!var_1_selected || !var_2_selected || !var_3_selected) |
warned.ShowDialog(); |
} |
//********if user is missing something, i want to stop here and start over***** |
|
//passes variables to another class |
this.pass_variables(); |
|
//closes form |
Close(); |
} |
I had a do while loop surrounding everything except the last two statements, but that just made the second window pop up non-stop so that the user had no chance to change anything.
I hope I explained my issue well enough.
Thanks for any help.