0
How to fire an event on form close
I think I'm missing something in the syntax. I have two win forms. One is Login and the other is Main. Upon successful login, Login form gets hidden and Main is shown. When I quit the Main, Login is still active in the background so the app is still running. How to fire an Application.Exit() when Main gets closed, I've tried a bunch of functions but none seem to do the trick?
4 ответов
+ 8
that mean to:
login form for button "OK" put:
me.hide()
mainform.show()
mainform for button "Close" put:
me.close()
+ 7
did you try to put in the login form
main.show()
me.hide()
+ 7
if you are using visual basic in the login form this code will work
me.hide()
Mainform.show()
you can use "me.close()" in the Mainform and it will close the application.
this.hide() // this is not defined in visual basic
0
No, it's called from Login form -
on button click if user / pass OK then
this.hide
MainForm.show
But I don't know what is the event that is triggered when I close the Main form, so I can put Application.Exit() inside it.