Dela via


How to: Use Reference Highlighting

When you click a symbol in the Code Editor, all instances of the symbol are highlighted in the document. You can move between highlighted symbols by pressing CTRL+SHIFT+DOWN ARROW or CTRL+SHIFT+UP ARROW.

Highlighted symbols may include declarations and references, and generally anything else that Find All References would return. This includes the names of classes, objects, variables, methods, and properties.

For many Visual Basic control structures, when you click a keyword, all of the keywords in the structure are highlighted. For example, when you click If in an If...Then...Else construction, all instances of If, Then, ElseIf, Else, and End If in the construction are highlighted.

The Visual Basic control structures that support keyword highlighting include the following:

To move between highlighted symbols

  • Press CTRL+SHIFT+DOWN ARROW or CTRL+SHIFT+UP ARROW.

To enable or disable reference highlighting

  1. On the Tools menu, click Options.

  2. In the Options dialog box, expand Text Editor, and then complete one of the following tasks:

    • For Visual Basic, expand Basic, click VB Specific, and then select or clear Enable highlighting of references and keywords.

    • For C#, expand C#, click Advanced, and then select or clear Highlight references to symbol under cursor.

To change the reference highlighting color

  1. On the Tools menu, click Options.

  2. In the Options dialog box, expand Environment, and then click Fonts and Colors.

  3. In the Show settings for box, click Text Editor.

  4. In the Display items list, click Highlighted Reference.

  5. In the Item background box, click the appropriate color.

See Also

Tasks

How to: Search for Objects, Definitions, and References (Symbols)

Reference

Code and Text Editor

Automatic Brace Matching

Other Resources

Control Flow in Visual Basic