2009-11-13 22 views

回答

2
foreach (UIElement child in grid.Children) 
{ 
    MatrixTransform t = (MatrixTransform)child.TransformToAncestor(grid); 
    Point childLocation = new Point(t.Value.OffsetX, t.Value.OffsetY); 
} 

會給你所有直接孩子相對於Grid的座標。

+0

非常感謝!非常感謝! – geejay

+0

不客氣:) –

相關問題