*
MSDN*
Bing 제공
|개발자 센터
MSDN 홈 > Visual Studio 홈 > Visual Studio Express > Visual Basic > Feature Tour - IDE

Interactive Development Environment

My Namespace

The My Namespace offers you convenient access to a wealth of functionality, relieving you of having to write a great deal of code manually. My Namespace enables you to quickly access data in your application, your local computer, the collection of forms in your application, your application’s settings, application users, and Web services.

With one line of code, you can access information and functionality normally accessible through My Computer. For example, you could play an audio file, access files and folder via the file system, write to and read from the registry, and more.


XML comments


view larger >

XML comments are a way to add documentation to your code in a simple and uniform way. By adding three quotes in a row (’ ’ ’) at the beginning of a function or subroutine, Visual Basic Express will dynamically generate the XML template including the parameters and return values. This XML data can be read by other popular documentation generation tools such as NDoc to produce professional-looking documentation for your application or component.

Task List

Similar to the Outlook task list, the Task List lets you keep track of tasks that you have to complete in your coding project. You can automatically add an entry into your task list by simply adding a comment in your code using the following format “’TODO: My comment here”. You can then double click on a task in the task list to jump directly to the corresponding line of code.

Find All References

When developing large solutions, it may be helpful to determine where a particular class or member is referenced throughout the solution. To do this, right-click the class, then click Find All References. This displays all references to that class throughout the current solution. This technique is more accurate than using the standard find functions, as it uses the compiler to find the exact matches for the corresponding class. The following diagram shows a display of all code referencing the Contact class.

IntelliSense

This is one of the most popular features of Visual Studio that can save you countless hours over the course of a project. IntelliSense is a feature that provides statement completion as you type for accessing properties, methods, and events. Upon typing the name of an object, typing dot “.” will cause a popup list to appear displaying the available elements. In the following diagram, you can see all of the available methods and properties for the List class.

IntelliSense is also invaluable for writing code such as exception handling. When adding a Try/Catch block, IntelliSense filters the available options to show only a list of exception types.


This filtering also applies to attributes. Attributes let you specify descriptive metadata to a method, class or assembly. For example, you can update your application version number by updating the AssemblyVersion attribute. The following diagram shows how IntelliSense will automatically filter to only show attribute types.


Visual Basic Express has a convenient namespace member filtering feature that quickly helps you to find the most commonly used members. The following diagrams show the tabbed IntelliSense menu when accessing members of the My.Computer namespace.


IntelliSense Code Snippets

To make writing code easier, Visual Basic Express includes a feature called IntelliSense Code Snippets which are extensible fill-in-the-blank snippets of code. Visual Basic Express includes over 400 pre-built code snippets for tasks like reading and writing files, working with data in a database or interacting with devices on a serial port. There are even Code Snippets for performing common tasks such as calculating mortgage payments. To insert a snippet, right-click anywhere in your code, click Insert Snippet…, and select the snippet you need. The diagram below shows the context menu for choosing your snippet.

To find a snippet, drill down through the category folders into which snippets are organized until you find the one you need. This helps you locate your target code faster, rather than eyeballing a single long list of snippets.

As you drill down, you’ll see a “breadcrumbs trail” that shows the sequence of folders you navigated to get to where you are. You’ve probably seen a similar interface on Web pages. The diagram below shows an example of the breadcrumbs trail.


Once you’ve inserted the snippet, you’ll notice fill-in-the-blank regions highlighted in green for you to edit and customize to your needs. You can jump from region to region use the tab key for quick editing.


IntelliSense Code Snippets can also be customized, so you can create your own and share them with fellow coders! You can learn more about customizing your own IntelliSense Code Snippets on Fully Cusomizable

Renaming variables

Once you’ve written a lot of code in a project, it can be tedious to rename a poorly named variable as you may have 10, 20, or 100 different lines of code to manually change. To help automate this process, Visual Basic Express offers automatic renaming capabilities so that you only need to make one change and the tool will automatically update all of the correct references for you. To use the Rename function, simply right click on a variable name like textBox1 and select Rename….

You are then prompted to enter a new name for the variable as shown in the Rename dialog box.


Navigate code


view larger >

Finding your way around source code files can involve lots of scrolling. Visual Basic Express makes this navigation easier with two drop-down lists in the source designer pane. The list on the left allows you to choose from one or more class definitions in the file, while the list on the right lets you jump right to the method in question.

Go To Definition

Finding sections of code can sometimes be challenging. But features in Visual Basic Express make it much easier. For example, right-clicking on a variable or a class and choosing Go To Definition takes you to the place in code where the type was defined. If the class is not part of the project, you are taken to the appropriate entry in the Object Browser.

< previous | next >




Microsoft