simonwait
asked on
User Control adopt parent User Controls property
I have a user control called MoveIndicatorCtrl with a user control within it call EnableSideCtrl. Both have a property called AsNummer. I would like that when the MoveIndicatorCtrl initializes that it sets the EnableSideCtrls AsNummer property to its own. I keep trying EnableSideControl.Asnummer = Asnummer but its no good.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect. I actually started working with your original solution to then work in the Asnummer2 bit plus a few others but then when accepting I saw your addition. Thanks very much
Public Property Let AsNummer(ByVal t As Long)
AsNummer = t
End Property
... it is not allowed to assign a value to "AsNummer" like this:
Private Sub UserControl_Initialize()
AsNummer = 2
End Sub
... because (on startup) we'll get an "overflow error" in our .vbp Project.
Instead, we could create a second variable "AsNummer2" and write a value to it :
Public Property Let AsNummer(ByVal t As Long)
AsNummer2 = t
End Property
UserControl-Initialize--4.zip