i have these property in usercontrol:
and i have these in:Code:Public Property Get StripsActivate() As Boolean StripsActivate = Strip.Activate End Property Public Property Let StripsActivate(ByVal vNewValue As Boolean) Strip.Activate = vNewValue If Strip.Activate = True Then Strip.ActualSubImage = 1 lngActualSubImage = 1 lngTotalSubImages = Strip.ImagesColumn * Strip.ImagesLine Call UpgradeSubimages tmrAnimation.Enabled = True tmrAnimation.Enabled = Ambient.UserMode Else tmrAnimation.Enabled = False lngActualSubImage = 0 End If PropertyChanged "StripsActivate" End Property
and i have the same in writeproperties usercontrol event.Code:Private Sub UserControl_ReadProperties(PropBag As PropertyBag) If StripsActivate = True Then lngActualSubImage = PropBag.ReadProperty("ActualSubImage", 1) Strip.ActualSubImage = 1 lngTotalSubImages = Strip.ImagesColumn * Strip.ImagesLine Call UpgradeSubimages UserControl.Picture = PicAnimation(1).Image Call Transparent tmrAnimation.Enabled = True tmrAnimation.Enabled = Ambient.UserMode Else lngActualSubImage = PropBag.ReadProperty("ActualSubImage", 0) lngTotalSubImages = PicAnimation.Count UserControl.Picture = PicAnimation(0).Image Call Transparent End If end sub
my question is why i must repeat 3 times the code for a persistence property?
thanks





Reply With Quote