Debugging event handlers
You can use the same basic techniques to debug event handlers as you do for any other code sections.
These are the general steps for approaching error handlers:
Open the Debugger and load the program containing the event handler code.
Set a breakpoint.
Run the program, either at full speed, or by stepping or tracing through it.
When the program opens a form, the form gets focus. Interact with the form to trigger the event associated with the event handler. For example, if the event handler is an onClick method for a pushbutton, click the pushbutton.
When the event handler reaches the line or condition specified by the breakpoint, execution stops and focus returns to the Debugger. You can then inspect, step, or perform other debugging tasks.