Short note for methods and properties ???

alexk

Freshman
Joined
Jul 23, 2002
Messages
34
Location
Israel
I was create a little class with property and method.
How can I add a short pop-up "note" to property or method like in original VB.NET methods and properties?
See attachment picture for example.
Thanks.
 

Attachments

FIrst you create a property then in an event, sub, or function, you can reference that property by using:
Visual Basic:
Me.

Try This:
Visual Basic:
Public Class Form1
    Inherits System.Windows.Forms.Form

   Private MyStrPropertySTORAGE As String
   Public Property MyStrProperty() As String
      Get
         ' The Get property procedure is called when the value
         ' of a property is retrieved. 
         Return MyStrPropertySTORAGE
      End Get
      Set(ByVal Value As String)
         ' The Set property procedure is called when the value 
         ' of a property is modified. 
         ' The value to be assigned is passed in the argument to Set. 
         MyStrPropertySTORAGE = Value
      End Set
   End Property

   Private MyIntPropertySTORAGE As String
   Public Property MyIntProperty() As String
      Get
         ' The Get property procedure is called when the value
         ' of a property is retrieved. 
         Return MyIntPropertySTORAGE
      End Get
      Set(ByVal Value As String)
         ' The Set property procedure is called when the value 
         ' of a property is modified. 
         ' The value to be assigned is passed in the argument to Set. 
         MyIntPropertySTORAGE = Value
      End Set
   End Property

  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.MyStrProperty = "Text" ' This is a string property
    Me.MyIntProperty = 1024 ' This is a integer property

  End Sub
End Class
 
I think that Alex is talking about the tooltip that appears next to a property or method in the dropdown list in the IDE.
 
That is a C# feature, it gets those tooltips from the inline XML documentation that is part of the language spec.

There is probably a tool that lets you do the same from VB.NET, but I don't know of one.
 
Yes, exactly. I'm talking about the tooltip that appears next to a method in the dropdown list in the IDE.
Can anyone HELP me?!
 
Does anyone know how to do this in VB.NET???

Just to reiterate, I want to assign a description to each of the properties/methods of my class so that when you're using the IDE you get a tooltip with the description, just like the existing .NET objects.

Additionally, how can this be extended to include descriptions for method parameters too?
 
Thanks.

I thought I remembered seeing something along these lines a few days ago but I douldn't find it.

I even remembered that it had the word "ToolTip" in the title but when I searched I couldn't find it. Turns out it was "ToolTips" with an "s".... DOH, so close.
 
Back
Top