Is there a way to display line numbers in the VB6 / Visual Studio 6.0 IDE?
Asked Answered
G

5

46

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

Goering answered 1/3, 2010 at 20:24 Comment(0)
S
65

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.

Salinger answered 1/3, 2010 at 20:43 Comment(4)
@user210757 fixed the picture for youBilateral
@ZacharyYates Haha! I forgot about this completely. Thanks for that.Salinger
This didn't in appear my VB6 IDE, but did after I entered the Customize dialog (right click on Toolbar > select Customize) then 'Reset' the 'Standard' toolbar.Pickel
I'm giving this an upvote just for the OVER 9000 comment.Amygdaloid
G
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.

Gadolinite answered 22/7, 2016 at 12:57 Comment(0)
D
0

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

Descriptive answered 15/6, 2020 at 4:15 Comment(0)
G
0

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

Ganley answered 17/8, 2023 at 17:36 Comment(1)
This does not answer the original question.Maier
S
-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 :)

Stapes answered 12/6, 2016 at 11:52 Comment(6)
Are you sure it is applicable to Visual Studio 6.0?Chatoyant
Oh thank you Andrew. I forgot to specify that. This applies to Visual Studio 2010 & up. I am not sure if it does apply to 6.0Stapes
The VB6 IDE does not have a "text editor" option that I can see (step #3)Gadolinite
The VB6 IDE Options are very limited compare with later versions of Visual Studio. Don't have line number option there.Wyoming
This does not apply to VB6Pentadactyl
Irellevant. Asked for VB6Maggot

© 2022 - 2024 — McMap. All rights reserved.