none
Pop up tips when referencing assemblies RRS feed

  • Question

  • Good day. This seems to be the most appropriate forum for my question. I have created a class library. When I reference a method in it while writing other code, the grey dialog pops up with the prototype. How do I add comments to this pop up?

    For example when typing in "MessageBox.Show("    the little dialog pops up    "1 of 21 MessageBox.Show(text as string) As DialogResult" and underneath that is the informational line "This displays a dialog with the text in it".  How do I add the information line in my class members?

    Thanks and have a good day

     

                                                                         

    

    Monday, August 14, 2017 2:45 AM

Answers

  • Good day. This seems to be the most appropriate forum for my question. I have created a class library. When I reference a method in it while writing other code, the grey dialog pops up with the prototype. How do I add comments to this pop up?

    For example when typing in "MessageBox.Show("    the little dialog pops up    "1 of 21 MessageBox.Show(text as string) As DialogResult" and underneath that is the informational line "This displays a dialog with the text in it".  How do I add the information line in my class members?

    Thanks and have a good day

     

                                                                         

    

    The intellisense that you're talking about can be added by using XML documentation:

    https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml

    The outline of the XML will be done for you once you do this: On the blank line above the class or member, type three "'" symbols (the same as a comment but three in a row. When you do that, you'll see the XML outline and your code will then support IntelliSense.

    ***** EDIT *****

    As an example:

            ''' <summary>
            ''' Gets or sets the action that the process should take if the 
            ''' target file exists. Default: "OverwriteAlways".
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ActionIfTargetFileExists As ActionIfTargetExistsType
                Get
                    Return _actionIfTargetFileExists
                End Get
    
                Set(ByVal value As ActionIfTargetExistsType)
                    _actionIfTargetFileExists = value
                End Set
            End Property


    "A problem well stated is a problem half solved.” - Charles F. Kettering


    Monday, August 14, 2017 12:46 PM

All replies

  • Good day. This seems to be the most appropriate forum for my question. I have created a class library. When I reference a method in it while writing other code, the grey dialog pops up with the prototype. How do I add comments to this pop up?

    For example when typing in "MessageBox.Show("    the little dialog pops up    "1 of 21 MessageBox.Show(text as string) As DialogResult" and underneath that is the informational line "This displays a dialog with the text in it".  How do I add the information line in my class members?

    Thanks and have a good day

     

                                                                         

    

    The intellisense that you're talking about can be added by using XML documentation:

    https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/program-structure/documenting-your-code-with-xml

    The outline of the XML will be done for you once you do this: On the blank line above the class or member, type three "'" symbols (the same as a comment but three in a row. When you do that, you'll see the XML outline and your code will then support IntelliSense.

    ***** EDIT *****

    As an example:

            ''' <summary>
            ''' Gets or sets the action that the process should take if the 
            ''' target file exists. Default: "OverwriteAlways".
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ActionIfTargetFileExists As ActionIfTargetExistsType
                Get
                    Return _actionIfTargetFileExists
                End Get
    
                Set(ByVal value As ActionIfTargetExistsType)
                    _actionIfTargetFileExists = value
                End Set
            End Property


    "A problem well stated is a problem half solved.” - Charles F. Kettering


    Monday, August 14, 2017 12:46 PM
  • Thank you folks. That is what I needed.
    Monday, August 14, 2017 4:10 PM