In the VB6 / Visual Studio 6.0 IDE, is there a way to display line numbers in the code editor like there is in recent versions of Visual Studio .NET?
For example, I would like to ask someone a question about their code and be able to say "In lines 10 through 13 of your MyClass.bas file, I noticed this happened."
You can press Ctrl + G . A prompt will then ask you what line number to go to.
On vscode, press Ctrl-Shift-P, and type user settings . Click on Preferences: Open User settings . in the settings search bar, type in line numbers . Then, on the Editor: Line Numbers: Controls the display of line numbers. , switch that to on if it isn't already.
Not that I know of. However, if you look at the toolbar when you have a code editor window open, there is a section that tells you the current line and column number the cursor is on:
Another possibility is to write an add-in for the IDE that can quickly highlight a range of lines. It's been awhile, but I'm pretty sure that the IDE's extensibility API lets you programmatically highlight sections of code in a code editor window.
This answer is not quite what you were asking, but I think it may still be useful / pertinent for people reading this question.
If you install the MZTools add-in to VB6, it has the ability to add line numbers in code to each line of each procedure / function / sub / etc.
This can be invaluable when trying to capture error information and you want to record the exact line number where the error originated at runtime. This is not needed in the IDE, but is very useful when trying to debug a compiled component in the field.
Edit: MZ Tools used to have a free version 3, which seems to no longer be available. But it worked well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With