Description of Function

P

patrickparent

I'm looking for a way to add comment directly in the tooltip that pops
when you type a function and you have to insert parameters.

Like the tooltips you have when you create a new ArrayList

Dim a as new arraylist(capacity)
capacity : The number of argument ...
 
Z

Zoe Hart

If you do the autodocumenting tags (signalled by three comment characters
''') and fill in comments for each parameter, those comments show up in the
tooltips. Here's how it looks for a method of mine:

''' <summary>
''' Writes a message to the Windows Event Log
''' </summary>
''' <param name="logName">Name of the target Log within the Event
Log</param>
''' <param name="sourceName">Name of the event Source</param>
''' <param name="machineName">Name of the target server where the Event Log
resides</param>
''' <param name="message">The message to be logged</param>
''' <param name="messageType">The EventLogEntryType (e.g. Error, Warning,
Information, etc.)</param>
''' <remarks></remarks>

Typing ''' causes VS2005 to generate the tags based on your method
signature. You then fill in the text within the tags.

When I make a call to that method in my code and hit the opening parentheses
the tooltip says "logName: Name of the target Log within the Event Log".

Zoe
 
H

Herfried K. Wagner [MVP]

I'm looking for a way to add comment directly in the tooltip that pops
when you type a function and you have to insert parameters.

Like the tooltips you have when you create a new ArrayList

Dim a as new arraylist(capacity)
capacity : The number of argument ...

VB 2005 supports XML comments out of the box. Simply type "'''" in front of
the method declaration.

Solutions for older versions of VB.NET:

Adding IntelliSense tooltips, XML comments, and documentation
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=tooltipsxmldocumentation&lang=en>
 
T

The Grim Reaper

Herfried,

Can you expand on your comment that VB 2005 supports XML comments?!? I
can't find it in the MSDN anywhere!
Don't suppose you could give a quick example?

___________________________________________
The Grim Reaper
 
T

The Grim Reaper

Sorry!! Worked it out myself!!

For anyone else as forgetful as me - you need to have "Generate XML
documentation file" checked under the Compile options of My Project.
________________________________________
The Grim Reaper
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top