Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
In Visual Studio 2010 Essential Training, author Walt Ritscher demonstrates how to use Visual Studio 2010 Professional to develop full-featured applications targeting a variety of platforms. Starting with an overview of the integrated developer environment, the course covers working with code editors, navigating and formatting code, and deploying applications. Also included are tutorials on running performance and load tests, and debugging code. Exercise files accompany the course.
As a programmer, you spend a sizable portion of your workday writing text. Oh, sure. We call it code, but think about it for a minute-- your code is just specialized text. And you probably write other text documents too. For example, HTML and XML files are common in software projects. So it won't surprise you to learn the Visual Studio has lots of text editors. In this movie, I want to show you some basic settings that you can configure for any text editor. I'm inside Visual Studio, and I have opened the BasicEditor project, and then I've open the Program.cs file.
I am going to start by showing you some navigation aids along the left edge of the screen. I am going to edit them by going to Tools > Options. You need to scroll down in Tools > Options till you get to the Text Editor section. Here you can see all of the different editors that are available inside Visual Studio. For example, down here is the XAML editor. Up at the top is some General settings, and that's where I am going to start. I am going to start by looking at these two items here: Selection Margin and Indicator Margin.
Selection Margin displays a vertical margin along the left edge of the editor's text area. You can then click in this margin to select an entire line of text, or click and drag to select consecutive lines of text. Right now, it's enabled, so if I click on OK, I can go in my code window, right along the edge here, and then hold my mouse button down and slide down the page to select multiple lines. I can disable that, and then it will just collapse that section down. Next to the Selection margin is the Indicator margin. It displays a vertical margin outside the edge of the editor's text.
I can click here to add things like breakpoints. This is also where we see symbols for things like bookmarks. Let me come down here and click right in this area, and you can see there is a red ball that shows up there. That's a breakpoint, and I'm able to turn that on and off by clicking here in the indicator margin. These are on by default, both these settings. One of my favorite features in the editors is line numbering, so let me show you how to enable at that. That is off by default. I am going to go back in the Tools > Options, and then I am going to come down here and click on All Languages.
This is going to affect all editors in Visual Studio. I am going to click here and choose Line Numbers and then click OK. And that's easy, self-explanatory, I now have line numbers in every editor. I find is really handy when working in code reviews. Another less popular feature, but one that I like nonetheless, is the ability to do word wrap. I am going to write a little bit of code here in a comment. I'm going to select it with my keyboard, do a Ctrl+C, and then paste in another line or two here. And as you can see, the text scrolls off the right edge of the screen.
Now, a lot of editors that you work with-- like for instance Microsoft Word--have the ability to wrap that line down to the next row, and Visual Studio has that setting too. I will go to Tools > Options > All Languages, and then I am going to click here, Word wrap. I can also put check mark here where it says, "Show visual glyphs for word wrap." What that does is it puts a little indicator icon on the right edge of the screen. Let me show you what I mean. I am going to click OK. Notice now that line 15 as a blank here and then line 16.
So this is considered to be all of line 15, even though it crosses two rows the editor. Over here on the right it is this little indicator glyph that says well you have moved on to the next row. If I make the window narrower, you see that it adjusts the text to fit on the second row. I'll make the window a little bit wider for the next demo, and then I am going to go up, and we are going to talk about a couple of other features. Tools > Options > All Languages.
At the top of the window is an autolist member and a parameter information. These are on by default, and I suggest you leave them on. Autolist members means that when you're typing your code, it'll automatically give you a dropdown list of all the coding items that are in scope at the moment. Parameter information is used when you're writing a method call and the method has multiple parameters, you can get a tooltip that will pop up in your window, showing you information about that particular parameter. At the bottom of the page is something called Navigation bar. Navigation bar turns on this top area in your Coding window. So if I unselect this and go back into my editor, you will see that those little dropdowns have disappeared.
Those are interesting for navigating through your code. Let me show you how those work. Tools > Options and select the Navigation bar check box and then click OK. How this works is this dropdown shows me all of the entities like the enumeration and the class that I have in my code. So I can click here and go to my file type enumeration down here, or I can go back to my program. And then when I am in this class, this class has two functions: Main and Save Files. So I can go over to this dropdown and use that to navigate back and forth between the Main and Save File function.
Naturally, in a real application we have more lines of code than this. This is a much more useful feature. Now that we have seen the general options available for text editors, the rest of the movies in this chapter focus on editors for each specific language.
Find answers to the most frequently asked questions about Visual Studio 2010 Essential Training.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.