Hi @rael isaac ,
Check the following steps about debugging.
Using Breakpoints
Set Breakpoints:
- Open your Visual Basic project in Visual Studio.
- Navigate to the code file where you suspect the issue might be occurring.
- Click in the left margin next to the line numbers to set a breakpoint. A red dot will appear indicating a breakpoint.
- Set breakpoints at the beginning of your main routines or suspected problem areas.
Run Your Program:
- Start debugging by pressing
F5
or selectingDebug > Start Debugging
from the menu. - Your program will run and pause execution at each breakpoint you have set.
Step Through the Code:
- Use
F10
(Step Over) to execute the next line of code without stepping into functions. - Use
F11
(Step Into) to step into functions to see what happens inside them. - Use
Shift + F11
(Step Out) to step out of the current function.
Using the Pause Button
Start Debugging:
- Start debugging your program by pressing
F5
.
Pause Execution:
- While the program is running and appears to be stuck, go to the Debug menu and select
Break All
(or pressCtrl + Alt + Break
). - This will pause the execution of all threads in your program.
Examine the Code:
- Visual Studio will show you where the code is currently paused.
- You can check the call stack, local variables, and other debugging windows to understand the current state of the program.
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.