Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to stop running of remaining code after calling close(). Am checking a condition and wrote the code currentwindowobject(this.close()) to close the window.

The issue is even though the window is closing the code after this.close() is executing so it creates an exception
Posted
Updated 12-Aug-14 0:11am
v2
Comments
Richard MacCutchan 12-Aug-14 5:04am    
Then you need to fix the bug in your program.
Herman<T>.Instance 12-Aug-14 5:08am    
exactly

1 solution

You have to add a return after Close() like in the next example:
C#
if(yourCodition)<br />
{<br />
   this.Close();<br />
   return;<br />
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900