控件都有left , top,width,height属性 有这4个属性就能知道控件覆盖的区域
判断2个控件是否有重叠的区域就可以了,
if
(image2.left
<=
image1.left
+
image1.width)
and
(image2.left>=image1.left-image2.width)
and
(image2.top<=
image1.top+
image1.height)
and
(image2.top>=image1.top-image2.height)
then
image2.visible
=
false
image1.visible
=
false
end
if
大概就是检测两个图片框的位置,如果符合条件就消失。
这段代码可以放在timer里或者在每一次图片框移动的过程就触发一次。