This works perfect when two Elements are brothers. It stop working when one is the father and the other is the son. I really don't know why and I would like to understand. I explain Better:
I want OfferBodyIn (a container) to be in the center of OfferBody (another container).
I try this
OfferBodyIn.X = OfferBody.X + ((OfferBody.Width - OfferBodyIn.Width)/2)
OfferBodyIn.Y = OfferBody.Y + ((OfferBody.Height - OfferBodyIn.Height)/2)
and that
OfferBodyIn.X = Parent.X + ((Parent.Width - OfferBodyIn.Width)/2)
OfferBodyIn.Y = Parent.Y + ((Parent.Height - OfferBodyIn.Height)/2)
If the two containers are brother it's perfect (I guess I will leave it like that)
Brothers
But if I put BodyIn inside Body, the first is not centered anymore
suspiciously if I put Body in the position 0,0 it worked good.