0

Hi,

I have a Windows Form frmMain() holding seven more-or-less unrelated UserControls, "ucFlopsy", "ucMopsy", "ucCottontail", etc...

I say "more-or-less" because each of the seven UC has three similar public read/write properties:
IsLocked (a boolean indicating if the following two properties are "Locked")
IsLockedID (if IsLocked=True then IsLockedID is an integer)
IsLockedName (if IsLocked=True then IsLockedName is a string)
There are no other attributes common to the seven UC.

frmMain can easily read/write the three public properties of each UC (me.ucMopsy.IsLocked...), but frmMain doesn't care about these properties!

How does ucFlopsy access those public properties of ucMopsy?

I need code in ucFlopsy (something that works, and this doesn't!)

If ucMopsy.IsLocked then
   'whatever
Else
   'whatever else
End If

izy

Edited by izyrider: stupid typo

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by izyrider
0

I have an ugly workaround in place.

in ucFlopsy

Protected WithEvents oMopsy as ProjectXYZ.ucMopsy
Public WriteOnly Property referenceMopsy As ProjectXYZ.ucMopsy
        Set(ByVal value As ProjectXYZ.ucMopsy)
            oMopsy = value
        End Set
End Property

in frmMain Load

Me.ucFlopsy.referenceMopsy = Me.ucMopsy

it works, but it sure is ugly.

Anyone have a better suggestion?

izy

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.