c# - Close a windows form then refresh another form -
i trying write program adds stock database,
the program wokrs add stock , show stock, issue im having when clsoe add stock form refresh main form show new current stock state.
this.formclosing += new formclosingeventhandler(addstock_formclosing); private void addstock_formclosing(object sender, formclosingeventargs e) { program.form1.showstock(); messagebox.show("tries close"); this.close(); }
when close form message box know getting point, problem message box keeps reopening , not close form.
the formclosing
event fired every time close
method called. if don't cancel closing event, form closed , that's it. don't need call again this.close()
.
this enough.
this.formclosing += new formclosingeventhandler(addstock_formclosing); private void addstock_formclosing(object sender, formclosingeventargs e) { program.form1.showstock(); }
Comments
Post a Comment