windows - C# ListBox_SelectedIndexChanged is like try-catch -


when there exception in listbox_selectedindexchanged, program jumps out of method, write code in try-catch block.

here example:

private void listbox1_selectedindexchanged(object sender, eventargs e) {     int x = int.parse("test"); //this should crash program } 

this works fine, in case crashes program

private void listbox1_click(object sender, eventargs e) {     int x = int.parse("test"); } 

this happening when run program in vs. when run explorer, crashes every time.

do know why?

do have stopping on exceptions enabled? see debug -> exceptions list of exception , when call debugger. can let debugger stop either when exception thrown or if wasn't handled (or both).


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -