How to handle form's ControlBox's Close Button
-
Hi, I have to excute my own functionality while closing the windows form. but its always firing formclosing event (I can not use formclosing event as I am using this to navigate to other forms) Finally, Please help me to solve, how to excute functionality of MyOwn Button while closing using ControlBox's X Button Thanks, Prashanth
-
Hi, I have to excute my own functionality while closing the windows form. but its always firing formclosing event (I can not use formclosing event as I am using this to navigate to other forms) Finally, Please help me to solve, how to excute functionality of MyOwn Button while closing using ControlBox's X Button Thanks, Prashanth
Call MyOwn Button's event handler in formclosing event.
Giorgi Dalakishvili #region signature my articles #endregion
-
Call MyOwn Button's event handler in formclosing event.
Giorgi Dalakishvili #region signature my articles #endregion
Thanks for your help Mr.Giorgi Dalakishvili, But that won't solve my Problem, See, I am not using MDI. I have Main Form which contains Exit,Form1 and few other buttons, and my functionality to close the application is written in exit button. But when user clicks any other button say,Form1 to go Form1, Since The Main Forms Close event also calling at that time the Main Form too closing not my application(So all the threads and timers that I wrote in exit button are not ending) I just want to know how to call my exit button functinality Only when user clicks ControlBox's X Button. Thanks,For ur Time Pashi
-
Thanks for your help Mr.Giorgi Dalakishvili, But that won't solve my Problem, See, I am not using MDI. I have Main Form which contains Exit,Form1 and few other buttons, and my functionality to close the application is written in exit button. But when user clicks any other button say,Form1 to go Form1, Since The Main Forms Close event also calling at that time the Main Form too closing not my application(So all the threads and timers that I wrote in exit button are not ending) I just want to know how to call my exit button functinality Only when user clicks ControlBox's X Button. Thanks,For ur Time Pashi
Your post is quite unclear but from what I guess that when you click Form1, your main form is closing. Why do you do that? Just show Form1.
Giorgi Dalakishvili #region signature my articles #endregion
-
Your post is quite unclear but from what I guess that when you click Form1, your main form is closing. Why do you do that? Just show Form1.
Giorgi Dalakishvili #region signature my articles #endregion
Thanks Again For your reply, say I am in Main Form Now. After I click on Form1 Button of Main Form, Main Form's Closing event is calling and since the in the ControlBox 'X' Button is also calling Main Form's Closing event for Main form the application is closing. So, I just want to know do I have any alternate so that, I can catch the form Closing Event I mean whether the process is entering into form closing event by ControlBox's 'X' click or while redirecting to any other form. Hope you got my point now! Thanks again for ur time
prashanth, s/w Engineer, Syfnosys.
-
Thanks Again For your reply, say I am in Main Form Now. After I click on Form1 Button of Main Form, Main Form's Closing event is calling and since the in the ControlBox 'X' Button is also calling Main Form's Closing event for Main form the application is closing. So, I just want to know do I have any alternate so that, I can catch the form Closing Event I mean whether the process is entering into form closing event by ControlBox's 'X' click or while redirecting to any other form. Hope you got my point now! Thanks again for ur time
prashanth, s/w Engineer, Syfnosys.
Maybe a
CloseReason
property of aFormClosingEventArgs
object which passed by aClosing
event is what are you looking for.Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.