View Full Version : user control properties


nathansav
02-14-2011, 07:41 AM
Hi,

I have added a property to my usercontrol, called NumberOfChildRecords. This property appears when i add the control and view its properties manually. However, i am adding this control by code, and this does not allow me to add this property.

ctlParent = New TreeViewv2.TreeView_Parent

With ctlParent
.Name = "tvw_Parent" & lngParentRow
.Top = 0 + (lngParentRow * intHeight)
.Height = intHeight
.Width = pnlTreeView.Width
.NumberOfChildRecords = rst.recordcount-1
End With

Can anyone advise why i cant seem to add via code.

Thanks.

DJkarl
02-16-2011, 10:17 AM
Is the proerty declared as private? If so try changing it to public.

nathansav
02-17-2011, 02:23 AM
Hi,

It was because when adding it, i defined ctl, the new control, as a control, rather than dim ctl as new TreeViewv2.TreeView_Parent at the beginning of my code.

Thanks.