Visual Studio IDE / Line Numbers
Subtitles of the Movie
Another great feature that's in Visual Studio 2008 Ð and it's actually been here for a while, as a matter of fact I think it was in the first release of Visual Studio way back when, when we went to the .NET platform, so when I say way back then of course I mean like 2001, 2002 Ð is the ability to add line numbers to our code. Now, I've opened the Hello World application. Now I actually created this little application back near the beginning of the Course and so if you'll just go look for the video entitled Hello World Again, you'll see where I built this pitiful little application. But I designed it, just did it very simply, so you'd kind of get a feel for how to program in Visual Studio, and this is for you new folks who are new to this environment. But I want to show you something else. If I go to my Form1.VB page and if you've got this form opened and you can't see Form1.VB, just double-click on the Button. But if you remember, this is the code that I wrote before. Well, this is kind of cool, but again, keep in mind that there could be lots of other code in here, right? And it could take up a whole lot more lines, and when you're working in code you're going to get error messages from time to time when you try to compile, that you've got errors on certain lines and so forth, and if you'll notice that as I click the mouse on different lines, if you'll look right down here at the bottom of the screen, this is telling me that I'm on Line 3, and so if I come down and click, you'll notice that I'm now on Line 4, and now I've got Word Wrap on and so you'll notice that all of this is actually one line, so if I click here and then click here it stays on Line 3, but if I come down one more it's on Line 4 and I can make that just a little more apparent for you by spreading it out. There's Line 3 Ð all that's one line Ð and then of course, there's Line 4, Line 5, and then notice it's also showing me which column I'm in, and if I use my arrow keys you can see these changing. Let's think about this. Wouldn't it be cool if I could see my numbers over here? Well, let me show you how to do that. It's not on by Default, don't know why it's not on, but I would like it to be on. I'm going to go to Tools, come down to Options, and then if you'll notice, usually it'll come up looking something like this. If I go to the Text Editor section and click on All Languages, there's a little box here that says Line Numbers, and if I click that and hit OK, like magic Line Numbers appear on the left side and you'll notice these coincide. If I click on Line 9 here you see it down here. But this is telling me instantly, visually, what Line I'm on and it makes it a little easier. Some people, especially if you learned in Basic in some of those line-by-line languages, you got really accustomed to that and it's kind of like having that security blanket, the little teddy bear, or something, just seeing those Line Numbers over there helps. So, if you like the Line Numbers that's how to turn them on again. Let me show you one more time. Go to Tools, come down to Options, click on Text Editor to spread that out, go to All Languages, and you will see Line Numbers and you can simply turn those things on and you will have them to help you as you code and troubleshoot and just work your way through your applications. So, that's how to give yourself Line Numbers in Visual Studio 2008.
Tutorial Information
| Course: | Introduction to Microsoft Visual Studio 2008 |
| Author: | Mark Long |
| SKU: | 34008 |
| ISBN: | 1-935320-54-8 |
| Release Date: | 2009-06-26 |
| Duration: | 7 hrs / 72 lessons |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 