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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -