调用此方法时如何获取 textBox 元素的当前位置?
private void UserTextBox_GotFocus(object sender, RoutedEventArgs e)
{
}
更新
GeneralTransform gt = this.TransformToVisual(Application.Current.RootVisual as UIElement);
Point offset = gt.Transform(new Point(0, 0));
double controlTop = offset.Y;
double controlLeft = offset.X;
当我使用这个 controlTop 和 controlLeft 是 (0,0)