Debugger Stepping into everything

  • Thread starter Thread starter Gino
  • Start date Start date
G

Gino

Hi,

I have following code a close event for a form (WinForm VS2005)

If MsgBox("Are you sure you want to Exit Application ?",
MsgBoxStyle.YesNo + MsgBoxStyle.DefaultButton2, "Close Boris") =
MsgBoxResult.Yes Then
SaveOutstandingChanges()
Else
e.Cancel = True
End If

If I step through code and press Yes button on msgbox the debugger goes to
saveOutstandingChanges then highlights the E.Cancel line (Incorrectly). Has
anyone any ideas why this would/could happen?

I know I could place an exit sub after saveO.. and that would sort the issue
but I am seeing similar unexpected behaviour with debugger elsewhere and
trying to figure out what is causing it.
 
Hi Gino.

I cannot answer your questions but I suggest you use the MessageBox class
and its Show method instead of your VB function.

Gilbert
 
Gino said:
Hi,

I have following code a close event for a form (WinForm VS2005)

If MsgBox("Are you sure you want to Exit Application ?",
MsgBoxStyle.YesNo + MsgBoxStyle.DefaultButton2, "Close Boris") =
MsgBoxResult.Yes Then
SaveOutstandingChanges()
Else
e.Cancel = True
End If

If I step through code and press Yes button on msgbox the debugger goes to
saveOutstandingChanges then highlights the E.Cancel line (Incorrectly). Has
anyone any ideas why this would/could happen?

I know I could place an exit sub after saveO.. and that would sort the issue
but I am seeing similar unexpected behaviour with debugger elsewhere and
trying to figure out what is causing it.

I can't repro the problem.
Try cleaning the solution (Build menu). Also set "On Run, when build or deployment errors occur" in
the options dialog box to "Do not launch" (under "Projects and Solutions" -> Build and run)
 
Gino said:
I have following code a close event for a form (WinForm VS2005)

If MsgBox("Are you sure you want to Exit Application ?",
MsgBoxStyle.YesNo + MsgBoxStyle.DefaultButton2, "Close Boris") =
MsgBoxResult.Yes Then
SaveOutstandingChanges()
Else
e.Cancel = True
End If

If I step through code and press Yes button on msgbox the debugger goes to
saveOutstandingChanges then highlights the E.Cancel line (Incorrectly). Has
anyone any ideas why this would/could happen?

If all else fails, delete the project's "bin" and "obj" directories and
make a clean build.
 
Back
Top