Code not recognizing other container

I have a web page with 2 containers.

Container 2 has a button in it with some code pointing to container 1:

Dim ccRed As New CC_Red
Dim posLeft As Integer

posLeft = (CC1.width - ccRed.Width)/2
ccRed.EmbedWithin(CC1, posLeft, 0, ccRed.Width, ccRed.Height)

vCC_Red = ccRed

The main error is saying that CC1 does not exist.

How do I get the button code to acknowledge CC!?

Okay, then let me ask this question. Can a control in one container access or modify a control in another container - IOW’s is it possible?

The controls on one container have no knowledge of what is on the other container so you need to establish a connection between the two, this is probably the simplest method.

https://www.dropbox.com/s/fpoa3ornkg2hc90/TestForPeter.xojo_binary_project?dl=0

Julian, you’re the man!

I will study this a little later on.

Thanks.

Julian,

Thanks to your very simple example (and the simplicity was exactly what I needed), I am now able to apply that to my slightly more complex test case.

Muchos Gracias!