如何知道两个图片框是否在特定范围内发生碰撞。 C#

How to know if two picture boxes have collided on specific bounds. c#

我有两个图片框:pbXpbY

我想知道 pbX 右边界 何时与 pbY 左边界 相交。

这是我的代码:

 if (this.pbX.Bounds.IntersectsWith(pbY.Bounds))
            {
                /*Show message*/
            }

我怎么能这样做?

谢谢。

再用一张支票,大概是这样的:

if (pbX.Bounds.IntersectsWith(pbY.Bounds))
{
    if (pbX.Right >= pbY.Left) 
    {
       /*Show message*/
    }
}