How To Make Custom Close Button As Efficient As Windows Close Button In C#,Winforms

Dec 11 2012 12:10 AM
I Have A TextBox And Wrote TextBo1_Leave Event That When The TextBox Is Empty It Shows A Message 'TextBox Is Empty'And Focus Returns To The TextBox...I Had A Button 'Close' To Close The Form..For That I Had Wrote Button_Click Event To Close The Form 'this.Close();'..Now My Problem Is That When I Put The Cursor On The TextBox And makes The TextBox Empty And Try To Close The Form By Button Clicking..Then It Shows The Message 'TextBox Is Empty' And The Form Is Not Closing...But When I Click On 'x' Button Of The Form Then It Is Closing Without Asking Any Message..
Please Help Me To Make My Close Button As Efficient As Windows Close Button In C#, Winforms.

Answers (3)