This should do it:
Public Function GlobalLeft(extends r as DesktopUIControl) As Double
// For the control referenced, figure out the Global left by walking up the containment hierarchy.
Dim retValue As Double = r.Window.Left + r.Left
Dim p As Object = r.Parent
Dim container as DesktopContainer
While p <> r.Window
if p isa DesktopUIControl then
p = DesktopUIControl( p ).Parent
elseif p isa DesktopContainer then
container = DesktopContainer( p )
retValue = retValue + container.Left
p = container.Parent
end if
Wend
Return retValue
End Function
EDIT: Fixed an incorrect assumption.