Handle Closing Form?
Hello, I'm having some trouble handling the closing of my form. Currently I'm using the method below, but it for some reason runs 5 times instead of just once.
5 Replies
You must be making 5 mainforms then 😆
(or adding the same event handler somewhere else, or just running the method otherwise)
Use a debugger to look
Actually I think you're correct. I'm using
MainForm MainForm = new MainForm()
to access my MainForms controls from my other files. Is there another method I could use to access the MainForms methods/contains without creating a new one?Yes, pass the mainform as a variable to the constructor of things that need to call methods on it
Ahhh okay I'll look into that, thanks for all the help!
👍 gl