44

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."

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Ben McCormack
  • 32,086
  • 48
  • 148
  • 223

5 Answers5

64

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:

enter image description here

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.

Zachary Yates
  • 12,966
  • 7
  • 55
  • 87
Mike Spross
  • 7,999
  • 6
  • 49
  • 75
3

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.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
0

Install MZ-Tools and then perform following steps On the menu bar, choose Tools > MZ-Tools > Add Line Numbers

0

In Microsoft Visual Basic 6.0, open project: select all, copy, paste into Notepad++ In Notepad++, select Language, Visual Basic

hm96
  • 11
-9

Displaying Line Numbers in Visual Studio IDE

Line numbers are not displayed by default in Visual Studio. You can display them in a few clicks by following this simple algorithm :)

  1. On the Menu Bar, click "TOOLS"
  2. Select "OPTIONS" from the drop-down list
  3. Then click "TEXT EDITOR" to unwrap the list
  4. Choose "ALL LANGUAGES"
  5. Click the "LINE NUMBERS" box under Display
  6. Click "OK". Now your line numbers are displaying.

I hope this helps someone out there :)

Sadrak S.
  • 1
  • 2