How to add tooltiptext to my custom properties,methods,events?

  • Thread starter Thread starter JohnC
  • Start date Start date
J

JohnC

When working in the IDE, and you browse the properties, methods, or events
for a class, a handy tooltiptext pops up showing you something about the
item selected.

How can I create my own tooltiptext that will behave like this, when I'm
creating my own custom classes? Is there a magic keyword I can use when
defining the properties, methods, and events? A VB example would be much
appreciated.

Thanks to Herfried K. Wagner for his mention of the XML commenter tool (and
others) but unless I'm misunderstanding this issue, the links were not
related to this problem.

Thanks,
John
 
Hi,

In C# the XML documentation is used. I'm not sure if XML documentation is
available in VB.NET. It is however also possible to use attributes for this.
You can find more information on this here (it is a shortcut to the online
help):
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/T_System_ComponentModel
_DescriptionAttribute.htm

Here is an example of the DescriptionAttribute:

Description("The image associated with the control"), _
Category("Appearance")> _
Public Property MyImage() As Image
Get
' Insert code here.
Return image1
End Get
Set
' Insert code here.
End Set
End Property

I hope this solves your question.

Herman Eldering
 
Back
Top