Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

untitled.bmp

Posted

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

Me.

 

Try This:

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

UCM

>-)

  • 3 weeks later...
Posted

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?

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

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.

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...