我有两个图片框: pbX 和 pbY 。
我想知道 pbX右边界何时与 pbY左边界相交。
这是我的代码:
if (this.pbX.Bounds.IntersectsWith(pbY.Bounds))
{
/*Show message*/
}
我怎么能这样做?
感谢。
答案 0 :(得分:1)
再使用一次,可能是这样的:
if (pbX.Bounds.IntersectsWith(pbY.Bounds))
{
if (pbX.Right >= pbY.Left)
{
/*Show message*/
}
}