silverlight 获取控件坐标 没有canvas

        void t_GotFocus(object sender, RoutedEventArgs e)
        {
            var tb = sender as TextBox;
            var gt = tb.TransformToVisual(null);
            Point p = gt.Transform(new Point(0, 0));
            MessageBox.Show(p.X + " " + p.Y);
        }
posted @ 2011-06-21 17:04  liulun  阅读(910)  评论(2编辑  收藏  举报