We help IT Professionals succeed at work.

User Control adopt parent User Controls property

simonwait
simonwait asked
on
275 Views
Last Modified: 2012-02-15
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.
Comment
Watch Question

Commented:
if we have ...
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
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.