Adding Property to user control

NathanSav

Member
Joined
Feb 7, 2011
Messages
7
Programming Experience
10+
HI,

I have a user control that operates similar to a tree view, but with the neccessary tweaks for my company. However, i currently have a text box holding the number of children each parent has in the usercontrol ParentTreeElement. I have just moved this to the tag of the control, but ideally would like to add a property to hold that information.

I have tried adding the following to the code behind the usercontrol.

Property NumberOfChildren(ByVal lngNumberOfChildren As Long) As Long
Get
NumberOfChildren = prpNumberOfChildren
End Get
Set(ByVal Value As Long)
prpNumberOfChildren = Value
End Set
End Property

So i want to, when i add my control, it adds the count of their children to this property.

Thanks in advance

nathan.
 
Forgot to mention, i will be referencing this property from the Form, Form1, not within the actual control

so form1.add ParentTreeElement

then

ParentTreeElement.NumberOfChildren = rst.recordcount-1
 
Back
Top