winform 控件 point 位置计算

public Point PointToScreen(Point p)
{
    NativeMethods.POINT pt = new NativeMethods.POINT(p.X, p.Y);
    UnsafeNativeMethods.MapWindowPoints(new HandleRef(this, this.Handle), NativeMethods.NullHandleRef, pt, 1);
    return new Point(pt.x, pt.y);
}
posted @ 2019-12-21 10:57  哥,我还要  阅读(1020)  评论(0编辑  收藏  举报