如果布局在Grid中: 方法一: //_stackPanel为子元素,_grid为父元素 Point point = _stackPanel.TranslatePoint(new Point(0, 0), (UIElement)_grid); 方法二: //_stackPanel为子元素,_grid为父元素 GeneralTransform generalTransform = _stackPanel.TransformToAncestor(_grid); Point point = gener…