How to have comments in IntelliSense for function in Visual Studio?

后端 未结 12 1555
难免孤独
难免孤独 2020-12-04 10:42

In Visual Studio and C#, when using a built in function such as ToString(), IntelliSense shows a yellow box explaining what it does.

How can I ha

12条回答
  •  醉话见心
    2020-12-04 11:00

    What you need is xml comments - basically, they follow this syntax (as vaguely described by Solmead):

    C#

    ///
    ///This is a description of my function.
    ///
    string myFunction() {
         return "blah";
    }
    

    VB

    '''
    '''This is a description of my function.
    '''
    Function myFunction() As String
        Return "blah"
    End Function
    

提交回复
热议问题