Access to properties and methods of container control

If I have a containercontrol that has properties and events defined,
how can I access the properties and raise the events from a child control?

I have tried syntax like
mycontainer(me.parent).variablename = 6

and call mycontainer(me.parent).eventname

but not getting anywhere so far… Xojo reports these properties and events dont exist

To raise an event from outside a class, you must implement a method that raises the event, something like this:

Sub Notify (data As Object)
  RaiseEvent Notification( data )
End Sub

To access properties, they must be defined as public or protected D.pending on where you are writing the code, you can just call them directly or use the Self or Me prefixes. For example, if you’ve dragged your ContainerControl into a window and want to access its public Prop property from its Open event, you would write:

me.Prop = something

If you want to access it from elsewhere, you’d use the name of the subclass as the prefix:

myCC.Prop = something

Self.variablename = 6 ?

Not at my Mac, but a ContainerControl is basically like a window.

Thanks for the reply, Kem
I think this is looking at things from the other way round.

My container control has properties, and if I place that on a window, the window can access them without trouble.
The container control can access its own properties.
So much, so ‘like a window’

My container control has controls.
What I am trying to do is have those controls access the properties of the container they live within.

(I was hoping to expose properties of some of the controls as if they were properties of the container, through Inspector behaviour, but thats looking like it will need to be a computed property)

Edit: I;ll give that a try Markus. Sounds sensible, I haevnt tried it yet since I always associate ‘Self’ with the ultimately containing actual window…

That is one of the ContainerControl traps.

Self = the container control
Self.TrueWindow = the window the container control rests on. Even if the Container Control is embedded in other Container Controls.