CODE COLORING AND HIGHLIGHTING
The code editor displays different types of code items in different colors (although they all appear black or gray in this book). You can change the colors used for different items by selecting the Tools menu’s Options command and opening the Environment ⇒ Fonts and Colors option page.
The following table describes some of the default colors that the code editor uses to highlight different code elements.
| ITEM | HIGHLIGHTING |
| Comment | Green text |
| Compiler error | Underlined with a wavy blue underline |
| Keyword | Blue text |
| Other error | Underlined with a wavy purple underline |
| Preprocessor keyword | Blue text |
| Read-only region | Light gray background |
| User-defined types | Navy text |
| Warning | Underlined with a wavy green underline |
A few other items that may sometimes be worth changing have white backgrounds and black text by default. These include identifiers (variable names, types, object properties and methods, namespace names, and so forth), and numbers.
When the code editor finds an error in your code, it highlights the error with a wavy underline. If you hover over the underline, the editor displays a tooltip describing the error. If Visual Studio can guess what you are trying to do, it adds a small flat rectangle to the end of the wavy error line to indicate that it may have useful suggestions.
The assignment ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access