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
Post a Comment