how to override close
-
Hy everyone! I do want to overide the red cross for closing in my Windows.Form. I managed to do so by using
e.Cancel=false
in my code but well then it cancels every closecommand, meaning it cancels my command for closing via a button or via the menuitem of my trayicon. Well what I want to do is: If the user clicks the read cross (WinXP Style!) then the minimize operation is called. If the user clicks the button "Close" (on my Form) the the application is quit and if the user selects "Close" from my contextmenu of the trayicon then the application quits as well. But well how do I separate these three events, so the last two really close my application and the first one minimizes? Thanks! Stephan. -
Hy everyone! I do want to overide the red cross for closing in my Windows.Form. I managed to do so by using
e.Cancel=false
in my code but well then it cancels every closecommand, meaning it cancels my command for closing via a button or via the menuitem of my trayicon. Well what I want to do is: If the user clicks the read cross (WinXP Style!) then the minimize operation is called. If the user clicks the button "Close" (on my Form) the the application is quit and if the user selects "Close" from my contextmenu of the trayicon then the application quits as well. But well how do I separate these three events, so the last two really close my application and the first one minimizes? Thanks! Stephan. -
Hy everyone! I do want to overide the red cross for closing in my Windows.Form. I managed to do so by using
e.Cancel=false
in my code but well then it cancels every closecommand, meaning it cancels my command for closing via a button or via the menuitem of my trayicon. Well what I want to do is: If the user clicks the read cross (WinXP Style!) then the minimize operation is called. If the user clicks the button "Close" (on my Form) the the application is quit and if the user selects "Close" from my contextmenu of the trayicon then the application quits as well. But well how do I separate these three events, so the last two really close my application and the first one minimizes? Thanks! Stephan.Try using Application.Exit to really KILL it :) top secret xacc-ide 0.0.1
-
Stephan, in the button.click event use
Application.Exit()
instead ofMyForm.Close()
Kev Pearman MCPThanks! It works! :-) Stephan.