This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2005+

Highlighting Visual Studio Bookmarks

Bookmarks in Visual Studio provide a means by which you can mark important lines of code and quickly navigate between the marked items. By default, a bookmark appears as a glyph in the indicator margin. Some developers prefer increased visibility.

Bookmark Visibility

In an earlier article I described the use of Visual Studio bookmarks. This feature allows lines of code to be marked for fast navigation. When a bookmark is created, a glyph appears in the grey indicator margin to the left of the code. As most users of bookmarks use them for navigation purposes, the bookmark does not highlight the code itself in the manner of, for example, a breakpoint or tracepoint.

Some developers prefer that bookmarks do highlight the code. However, when you examine the Bookmark colours in the "Fonts and Colors" section of the Options dialog box, you find that a background colour for bookmarks already exists and that Visual Studio is choosing to not display it.

The Indicator Margin

The indicator margin is the grey margin that appears at the left side of the code editor window. This margin is used to display the glyphs that show the positions of bookmarks. When the indicator margin is enabled, bookmark highlighting is not applied to the code. To enable the highlighting, the indicator margin must be removed.

To hide the indicator margin, select Options from the Tools menu to display the Options dialog box. In the tree structure at the left of the dialog box, expand the Text Editor section and select the General options. You can then uncheck the Indicator Margin option.

Visual Studio Indicator Margin Option

When you click OK to accept the new setting, bookmarks will be highlighted, as pictured below:

Visual Studio Highlighted Bookmark

8 February 2009