Hello community!
I've made a add-in for inventor with many windows-forms. But if one form has been closed when the addin in inventor is running, it doesn't open again. How can i avoid this problem? I read something about to use the .hide() command on the red-x-close-button in windows forms, but i couldn't get it work. Does anyone know the problem or a solution?
I'm looking forward to every idea, so i can finally finish my project.
Best regards
Colli
Solved! Go to Solution.
Hello,
there are two possibilites:
//while closing the window in the close event this.Hide(); // hide the form instead of closing e.Cancel = true; // this cancels the close event.
//While opening check like this if(!form.Visible) { form.Show(); }
hope it helps
Thanks for your answer 🙂
I already found a solution but forgot to post it.
In my case i open a windowsform by clicking a selfmade button in the ribbon panel of inventor.
I had to place the constructor for the windowsform into the button_click handling sub, not above into the class.
If the constructor is placed in the class, only one windowsform object will be constructed by button click and if it gets closed it will not get constructed by every next button click.
When the constuctor is placed in the button_click sub, the windowsform objekt will be new constructed every time the button gets clicked.