How to add description to functions and function parameters?

Phonon picture Phonon · Apr 19, 2011 · Viewed 54.4k times · Source

I'm writing a VB.NET function with a ton of overloads. I've seen that most .NET functions have parameter descriptions in IntelliSense. For example, when typing in String.Compare(, IntelliSense says Compares two specified System.String objects and returns... you get the idea. This description changes and you click through different overloaded versions of the same functions. When you start typing in something for a parameter, it describes the parameter you're currently inputting as well. Example: strA: The first string to compare..

How can I give such descriptions to my functions?

Answer

Jeff Stock picture Jeff Stock · Apr 19, 2011

All you have to do is key three apostrophes on the line before your function. .NET will add the rest of the code for you. Insert the text you want displayed in the intellisense in the tag.

''' <summary>
''' Returns the name of the code.
''' </summary>
Function GetName() As String
    Return "Something"
End Function