4

I'm trying to have different colors of text in the XML doc comment like how the word true, false and Window are in blue and green colors in the picture below.

Colored XML documentation comments

I tried decompiling the code that had these but the xml doc was different and there's no mention of this kind of coloring in Microsoft documentations as well.

4
  • See following : learn.microsoft.com/en-us/previous-versions/visualstudio/… Commented Dec 22, 2020 at 18:29
  • 3
    You can't customize the color of arbitrary words. The highlighting matches the syntax highlighting for "Keywords" and the "User Types - *" items in Tools > Options > Fonts and Colors. It knows, for example, that Window is a type based on <see cref="Window"/> in the XML. It then examines the actual type, sees that it's a reference type, and uses the configured color. Commented Dec 22, 2020 at 18:30
  • 6
    Just to add tot he previous comments, the true, false, null and other keywords are defined with <see> tag too. For example, <see langword="true"/>. See helixoft.com/blog/… Commented Dec 22, 2020 at 20:46
  • thank you @madreflection and Peter Macej. i missed <see cref="Window"/> but the other one (langword) is not mentioned in Microsoft documentations somehow. if any of you want to take credit for the answer please do. Commented Dec 23, 2020 at 14:35

1 Answer 1

8

To get the blue color for true use this syntax inline: <see langword="true"/>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.