Udostępnij za pośrednictwem


Code and Text Editor

The editor is the word processor of the integrated development environment (IDE). When it is used to edit text, it is referred to as the text editor. When it is used to edit source code in a Visual Studio development language, which is its more common use, it is referred to as the code editor.

You can open multiple code editors to view code in different forms or modules, and you can copy and paste among them. The following table shows various ways to open the code editor.

To open the code editor from

Do this

Solution Explorer

Select a form or module and click the View Code toolbar button, or double-click the form or module.

Windows Forms form or Web Forms form

Select the form or any of its controls and then, on the View menu, click Code. You can also right-click the form and then click View Code. In many cases, double-clicking a component on the design surface also opens the code editor.

File menu

Click New or Open to display a code file.

A list of all documents open for editing in instances of the code editor is available on the Windows menu. The HTML Designer, CSS Editor, and XML Editor features of the IDE also employ this editor.

For most development languages, the code editor offers these features:

  • Access to object properties, methods, and events at design time.

  • IntelliSense statement completion.

  • Collapsible code sections.

  • A Code Definition Window that displays the source code for an object or element.

  • A Code Snippet Inserter that lets you add ready-made blocks of model code.

  • Options to define indents, tabs, and drag-and-drop behavior.

  • Unicode code pages.

User Interface Element List

  • Code pane
    The area where code or text is displayed for editing. It provides IntelliSense statement completion for the language in which you are developing. For more information, see Using IntelliSense.

  • Indicator margin
    A gray column on the left side of the code editor where indicators for breakpoints, bookmarks, and shortcuts are displayed. Clicking this area sets a breakpoint on the adjacent line of code.

  • Selection margin
    A column between the indicator margin and the editing window where you can click to select lines of code. Changes to code are tracked here when you select the Track Changes option in the Options dialog box. For more information, General, Text Editor, Options Dialog Box.

  • Horizontal and vertical scroll bars
    Lets you scroll the code pane horizontally and vertically so that you can view the code that extends beyond the viewable edges of the pane.

In This Section

See Also

Tasks

How to: Outline and Hide Code

How to: Create Task List Comments

How to: Debug Code in the Editor

How to: Manage File Storage

Other Resources

Solution Explorer