The Visual Studio .NET Desktop


Okay, first you'll need to start up Visual Studio .NET (see Figure 6-1). If you chose to install Visual Basic .NET or C#, you'll notice that they use Visual Studio .NET as well. This ability for your code to be language neutral, as discussed in Chapter 1, is a core feature of the .NET Framework. It only makes sense that the environment for developing your code is language neutral as well.

click to expand
Figure 6-1: The Visual Studio .NET splash screen

Once you get beyond the splash screen, you are placed directly into the Visual Studio .NET development environment. At first glance, those of you who have worked in any of the more recent Microsoft development environments might be in for a bit of culture shock. A lot has changed, but you can return your environment to the way you like it. Mostly what Microsoft has done is provide you with more control over how your desktop looks. They've also made better use of space by providing nearly everything as a border-tab window.

A border-tab window allows you to tuck the window away in the border for safekeeping when you aren't using it, as shown in Figure 6-2. You can also tack it up to the border and leave it fully expanded or pull it away from the border and make it a stand-alone window. With a border-tab window, you can make your desktop look exactly how you want it and not how the package designer thinks you want it.

click to expand
Figure 6-2: A fully tabbed development window

I personally like to tuck away the views when I'm not using them, which gives me a larger area to display code. But with higher and higher resolution monitors coming out every other day, I think my tucking days are quickly coming to an end.

Managed C++ developers will probably be more concerned with the following ten views while developing their code. All but the first and last are border-tab windows.

  1. Menu and standard toolbars

  2. Class View

  3. Index window

  4. Solution Explorer

  5. Server Explorer

  6. Task List

  7. Toolbox

  8. Properties window

  9. Output window

  10. Main development tab window

Visual Studio .NET provides many other development views. You won't use most of these views as a Managed C++ programmer. On the other hand, be sure to experiment with the Visual Studio .NET IDE—you might find a hidden treasure or two that I don't cover in this chapter that will make your coding life easier.

There's also another set of views that you'll work with when you're elbow deep in debugging. If you've worked with a symbolic GUI debugger before, none of the views will come as any great surprise. For instance, the Visual Studio .NET debug environment provides an autovariable view, a breakpoint view, a call stack view, an output view, and many others. You'll examine these views later in this chapter when you blow up DeckPlayer.exe and then try to figure out why it's not working.

By the way, to add a view to your environment, you need to select the view from the View menu. Alternatively, in many cases, there is a hot key equivalent you can use to bring up the view. To remove a view, click the close view button, which looks like a standard window close button (i.e., an X).

Menu and Toolbars

What's a Windows application without a main menu and toolbars? You can lay these elements out as you like, just as you can with border-tab windows. In fact, you can pull out a toolbar, make it its own view, and place it anywhere on the desktop. It seems the main menu is about the only thing that you can't change the position of. Not that I can think of a reason to change its position, but I'm sure somebody will be upset and ask Microsoft for the menu to be moveable as well.

As you spend more time with Visual Studio .NET, you will notice that the menu and toolbars change as you perform different functions. This is a cool feature and something that most Microsoft products have included for quite some time. Figure 6-3 shows the default starting menu and toolbars after you open up a project.

click to expand
Figure 6-3: Default project menu and toolbars

Because this isn't a book about Visual Studio .NET, I won't go into detail about the menu and toolbars. Truthfully, I think most programmers work with menus and toolbars without needing much guidance.

Class View

The Class Wizard is gone. To some, this might be a huge step backward, as the wizard did provide a lot of functionality. If you're planning on continuing to code MFC, I can see the removal of this tool as a problem, but for those of you moving to Windows Forms, it isn't a great loss.

The reason it isn't a great loss is that developing Windows Forms is much different than developing MFC Windows. With Windows Forms, all you need to do is drag user interface controls to the form you want to build and then update its properties and events—very simple and clean. You don't need a wizard to handle that.

What you might use instead of the wizard is the Class View (see Figure 6-4). This tool allows you to drill down through the entire application and examine every class, property, and variable. It also allows you to add more classes, properties, and variables of your own with easy-to-use wizards. Personally, I find it easier just to type the code in directly, but that might be just me.

click to expand
Figure 6-4: Class View for DeckPlayer

Index Window

Most likely you will spend many an hour working with the Index window because, if nothing else, the .NET Framework is well documented and this tool provides you access to the documentation. Visually, there is not much to the Index window, as you can see in Figure 6-5. It just contains a search string for the index and a drop-down box to filter your search through the index to the areas in the documentation that are most applicable.

click to expand
Figure 6-5: Index window for the System. Windows.Forms namespace

It is possible to search the contents of the .NET Framework documentation using the Search window, but I find that the Index window is quicker and, in many cases, provides more relevant documentation than the Search window. With the Index window, though, you have to sort of know what you are looking for. (This is the main reason why I provide Chapter 5, which covers the .NET Framework class library.)

A drawback of the Index window is that it doesn't use Managed C++ syntax for the .NET Framework class library, as namespaces aren't delimited by two colons (::), but instead use the C# syntax of being delimited by a period (.). This really isn't a big deal.

Solution Explorer

As your projects get larger and more complex, you will find Solution Explorer extremely handy (see Figure 6-6). Not only does it provide you with the ability to maintain the names of all the files that make up your solution, but it also allows you to organize the files into projects and folders. When you add versioning with Microsoft Visual SourceSafe, you have a powerful environment in which to maintain your source code.

click to expand
Figure 6-6: Solution Explorer for the DeckPlayer project

Solution Explorer is the heart of all your development with Visual Studio .NET. You will add, delete, and maintain all your files using it. You can initiate activities such as debugging sessions or building and running executables. It will also be the location where you set up the autocopying of assemblies from local build directories to the global assembly cache (GAC) or application root directories.

Something that you should note is that even though it appears that you have created multiple folders and placed files in them, in reality, the code files all stay within one directory. The only exception to this is that subprojects reside within their own directory structure.

Server Explorer

This new feature of Visual Studio .NET provides you with considerable control over your system. No longer do you need to exit the development environment to examine your event logs, message queues, and performance counters. In addition, Server Explorer provides for full service and database maintainability.

Server Explorer allows you to examine your local server, and with the proper privileges, you can also work with remote servers. In Figure 6-7, the data connection DOTNET.CONTENTMGR.dbo is a remote database that I access over the Internet. There, I store my data for my content management system, which I developed in my previous Apress book, Real-World ASP.NET: Building a Content Management System.

click to expand
Figure 6-7: Server Explorer for local and remote servers

With all this functionality available from Server Explorer, you will most likely (at least at first) use it mainly as a tool to design, create, and maintain your databases. You will be pleasantly surprised by the amount of control you have over your database construction. Chapter 12 covers Server Explorer's database functionality.

Task List

The Task List (see Figure 6-8) is a handy view that adds a couple of features to your development environment. The most important feature, obviously, is its error-detection capability—errors from an unsuccessful compile are listed here. The Task List provides a description of the error, the file that the error occurred in and, finally, the line number where the error was detected. Double-clicking the Task List on the error task brings your cursor to the line of code in error.

click to expand
Figure 6-8: Task List with an error and a to-do

The second feature of the Task List is the lesser-used to-do list. If you are new to the programming world, you will be amazed at how quickly you start to forget things that need to be done. This view provides you a way of jotting down to-do tasks as you think of them. And, because the tasks are now part of the project, you will not forget them. You check off the tasks as you complete them. To-do tasks remain with the project until you physically delete them, which provides you with a history of the tasks you accomplished while developing the code.

Toolbox

You will become intimately familiar with the Toolbox view (see Figure 6-9), especially when you start developing Windows Forms. The Toolbox contains an assortment of controls and components that you can drag and drop to your main development window. This view, in conjunction with the main development window and Properties window, allows you to visually build your Windows application's GUI front ends. You will explore this drag-and-drop aspect of the Toolbox view in more detail in Chapters 9 and 10.

click to expand
Figure 6-9: The Toolbox view for Windows Forms development

In the Visual Basic .NET and C# development environments, the Toolbox view is also used in Web Forms development, but unfortunately this drag-and-drop functionally is not supported in Managed C++.

Another neat feature of the Toolbox is its General tab, which can store things like code so that you can use them again at a later time. I'll show you how to use the Toolbox's General tab a little later in this chapter.

Properties Window

Like the Toolbox view, the Properties window (see Figure 6-10) is a something that you will use when developing your Windows Forms. It is your primary method of updating the look and feel of the controls that you placed on your main development window. It also provides you with a way to quickly add event handlers to the events generated by your controls. You will examine this window in detail in Chapters 9 and 10.

click to expand
Figure 6-10: The Properties window for Windows Forms development

Output Window

The Output window is read-only, but it's still valuable because it is here that the Visual Studio .NET environment dumps all its output. Most important, at least during development, this view displays the results of the compilation process (see Figure 6-11).

click to expand
Figure 6-11: Output of a successful build

Main Development Tab Window

The majority of Visual Studio .NET's desktop is the main development tab window (see Figure 6-12). Those of you who have used Microsoft products for a while might recognize this as a multiple document interface (MDI) viewer using a tab control. With this viewer, you can code your program, create resources, edit your database, create XML documents, view Help files, read online news, and much more.

click to expand
Figure 6-12: The default Start Page of the main development tab window

For those of you who don't know what a MDI viewer is, basically it's a window that presents documents to a user for viewing and, most likely, editing. The viewer is smart enough to know how to display a document based on the document's type. It also allows the document to be displayed in multiple formats. For example, an HTML file can be displayed as WYSIWYG or simply as a text document. As shown in Figure 6-12, the main development tab window has tabs for the HTML Start Page, Card.h, Deck.h, Cards.cpp, and DeckPlayer.cpp documents.

Note

Unlike the other views mentioned in this section, you access the Start Page view from the Help menu, not the View menu.

The main purpose of the main development tab window is for software development, but Microsoft also uses the window to communicate with the developer community by providing a standard HTML Start Page for all their users. On this page, you will find the latest news from Microsoft on Visual Studio .NET and the .NET Framework in general. The Start Page provides links to an online user community where you can get help from your peers. For those of you creating ASP.NET pages, Microsoft provides a list of Web hosts that can host your newest Web creations.

The Start Page also supplies a unique link called My Profile. The My Profile link provides you with a quick way of configuring your desktop. It comes in handy if you use multiple languages to develop your code. By using a single drop-down list, you can reconfigure your desktop for that language. Figure 6-13 shows My Profile configured for a Visual C++ developer. By simply selecting a different profile, you can configure the desktop for a Visual Basic .NET developer or a Visual C# developer, or you could even create your own custom configuration.

click to expand
Figure 6-13: Visual C++ developer profile

Dynamic Help

Another view that many developers might find helpful is the Dynamic Help window (see Figure 6-14). This view provides help in a dynamic way by updating itself as you perform tasks in the Visual Studio .NET environment. For example, as you edit a document and set your cursor over the preprocessor directive #include, the Dynamic Help window will present you with information about using the directive and possibly provide examples.

click to expand
Figure 6-14: Dynamic help for the #include directive

At first, I thought dynamic help a neat feature, but as time passed I found it distracting, so I stopped using it. Now, I keep all my border tabs closed so Dynamic Help will not be displayed anyway. But that is my preference. As mentioned previously, you can configure your desktop however you want, and how I like my screen has no bearing on how you might like yours.




Managed C++ and. NET Development
Managed C++ and .NET Development: Visual Studio .NET 2003 Edition
ISBN: 1590590333
EAN: 2147483647
Year: 2005
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net