Dela via


Introduction to the IDE (Visual C#)

The Visual C# integrated development environment (IDE) is a collection of development tools exposed through a common user interface. Some of the tools are shared with other Visual Studio languages, and some, such as the C# compiler, are unique to Visual C#. The documentation in this section provides an overview of how to use the most important Visual C# tools as you work in the IDE in various phases of the development process.

Note

If you are developing an ASP.NET 2.0 Web application, you will be using the Visual Web Developer IDE, which is a fully integrated part of Visual Studio. However, if your code-behind pages are in Visual C#, then you will be using the Visual C# Code Editor within Visual Web Developer. Therefore, some topics in this section, such as Designing a User Interface (Visual C#), might not be applicable to Web applications.

Visual C# Tools

The following are the most important tools and windows in Visual C#. The windows for most of these tools can be opened from the View menu.

  • The Code Editor, for writing source code.

  • The C# compiler, for converting C# source code into an executable program.

  • The Visual Studio debugger, for testing your program.

  • The Toolbox and Designer, for rapid development of user interfaces by using the mouse.

  • Solution Explorer, for viewing and managing project files and settings.

  • Project Designer, for configuring compiler options, deployment paths, resources, and more.

  • Class View, for navigating through source code according to types, not files.

  • Properties Window, for configuring properties and events on controls in your user interface.

  • Object Browser, for viewing the methods and classes available in dynamic link libraries including .NET Framework assemblies and COM objects.

  • Document Explorer, for browsing and searching product documentation on a local computer and on the Internet.

How the IDE Exposes the Tools

You interact with the tools through windows, menus, property pages, and wizards in the IDE. The following represents the basic IDE:

Visual C# Integrated Development Environment

You can quickly access any open tool windows or files by pressing CTRL + TAB. For more information, see Navigating and Searching (Visual C#).

Editor and Windows Form Designer Windows

The large main window is used by the Code Editor, the Windows Forms Designer, or the Windows Presentation Foundation Designer. You can switch to Code view or Design view by clicking Code or Designer on the View menu or by using the keyboard shortcuts F7 or SHIFT + F7. While in Design view, you can drag controls onto the window from the Toolbox, which you can make visible by clicking the Toolbox tab on the left margin. For more information about the Code Editor, see Editing Code (Visual C#). For more information about the Designers, see Windows Forms Designer and Getting Started with the WPF Designer.

The Properties window in the lower-right is populated only in Design view. It enables you to set properties and hook up events for user interface controls such as buttons, text boxes, and so on. When you set this window to Auto Hide, it will collapse into the right margin whenever you switch to Code View. For more information about the Properties window and the Designer, see Designing a User Interface (Visual C#).

Solution Explorer and Project Designer

The window in the upper-right is Solution Explorer, which shows all the files in your project in a hierarchical tree view. When you use the Project menu to add new files to your project, you will see them reflected in Solution Explorer. In addition to files, Solution Explorer also displays your project settings, and references to external libraries required by your application.

The Project Designer property pages are accessed by right-clicking the Properties node in Solution Explorer, and then clicking Open. Use these pages to modify build options, security requirements, deployment details, and many other project properties. For more information about Solution Explorer and the Project Designer, see Creating a Project (Visual C#).

Compiler, Debugger, and Error List Windows

The C# compiler has no window because it is not an interactive tool, but you can set compiler options in the Project Designer. When you click Build on the Build menu, the C# compiler is invoked by the IDE. If the build is successful, the status pane displays a Build Succeeded message. If there were build errors, the Error List window appears below the editor/designer window with a list of errors. Double-click an error to go to the problem line in the source code. Press F1 to see Help documentation for the highlighted error.

The debugger has various windows that display values of variables and type information as your application is running. You can use the Code Editor window while debugging to specify a line at which to pause execution in the debugger, and to step through code one line at a time. For more information, see Building and Debugging (Visual C#).

Customizing the IDE

All of the windows in Visual C# can be made dockable or floating, hidden or visible, or can be moved to new locations. To change the behavior of a window, click the down arrow or push-pin icons on the title bar and select from among the available options. To move a docked window to a new docked location, drag the title bar until the window dropper icons appear. While holding down the left mouse button, move the mouse pointer over the icon at the new location. Position the pointer over the left, right, top or bottom icons to dock the window on the specified side. Position the pointer over the middle icon to make the window a tabbed window. As you position the pointer, a blue semi-transparent rectangle appears, which indicates where the window will be docked in the new location.

Visual Studio Docking Windows

You can customize many other aspects of the IDE by clicking Options on the Tools menu. For more information, see Options Dialog Box (Visual Studio).

See Also

Concepts

Designing a User Interface (Visual C#)

Creating a Project (Visual C#)

Editing Code (Visual C#)

Building and Debugging (Visual C#)

Other Resources

Visual C#

Using the Visual C# IDE

Application Development in Visual Studio

Visual Web Developer

Visual Web Developer User Interface Elements