How can I save code changes in debugging mode in vb6
Solution 1:
Although the VB6 IDE does not provide this natively, an add-in for the IDE called MZTools has been around for ages which adds this feature.
Personally I've used MZTools 3.0 for many years, and this works really well.
This is what its help system says:
Shortcut To Save File At Debug-Time
The Shortcut To Save File At Debug-Time feature allows you to define a keyboard shortcut (Options window, Shortcuts tab) to save the selected file at debug-time. The Visual Basic IDE does not allow to save files at debug-time, but often it is useful to save the modifications that you have made to the source code at debug-time.
Remarks:
This feature is not available in the VBA version of MZ-Tools. This feature only works at debug-time. Since Visual Basic disables buttons or menus of add-ins at debug-time, the only way to save a file at those times is through a keyboard shortcut. The file must be previously saved at design-time, that is, MZ-Tools does not prompt for a name to save the file (it shows an error message instead).
This is the options window for how I have it configured locally:
Note that originally MZTools was free in version 3 and later they switched to a paid version; if I hadn't gotten v3 originally however it would be well worth paying for, not only for this feature.
Solution 2:
The short answer is you can't.
If you make the project before the crash, maybe this piece of code can be found in a ".tmp" file. But searching in .tmps is often a waste of time.
I particularly always force myself to stop the debug and save my progress. And I always use this setting which forces me to remember to save: