Is it possible to add a description to methods of a class?

B

Big Dave

I'd like to have a description included in the tool tip
(intellisense?) when I call a method from a class I wrote. Just to
make sure I'm describing this correctly, I'm talking about the yellow
box that comes up with I call the method in code that shows what
parameters that method required. Is this possible? If so, how would
I do that?

I know I can add <description("string here")> on a method of a custom
control, but how do I do it if it's not a control, just a class? I
can't seem to do it the same way.

Thanks for your help!
 
M

Mark Fitzpatrick

If you're using C# you can add some XML Comments like so

/// <summary>
/// This is a description of my method or property
/// </summary>

right above the definition of the method or property. This will show the
text right below the parameter information. Here is an example of a
property that sets a variable called _Text.

/// <summary>
/// This is a description of my method or property
/// </summary>
public string Text
{
set{_Text = value;}
}

Hope this helps,
Mark Fitzpatrick
Microsoft MVP- FrontPage
 
D

Dave

Unfortunately I'm using vb.net. I tried adding '<summary>Description
text</summary> right about my method, but that didn't work. Does
anybody know if there's a way to do this with vb.net?
 
G

Guest

VBCommentor will provide the ability to add coments to methods just like C#.

However, you can only see the comments if the consumer of the component is
in C#. :/

Basically, VB.Net doesn't see the comments, but if you take that same
component and use it in C#, you will see the information.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top