禁用一个图片框与另一个图片框的重叠 [英] Disable overlaping of one picturebox with the other

查看:70
本文介绍了禁用一个图片框与另一个图片框的重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击另一个picturebox2时我正在使用键盘的箭头键移动一个picturebox1我想停止而不是重叠picturebox2

解决方案

好的,所以在你移动之前第二个图片框,检查框的新位置和大小,并确保它不会与第一个图片框的位置和大小相交。这是非常简单的数学。有什么问题?


谢谢你我得到它,这不简单,因为运动是使用钥匙

,正如我所提到的..

Am moving an picturebox1 using arrow keys of keyboard when I hit another picturebox2 i want to stop and not to overlap the picturebox2

解决方案

OK, so before you move the second picturebox, check the new position and size of the box and make sure that it''s not going to intersect the position and size of the first picturebox. This is pretty simple math. What''s the problem?


Thank you all I got it,it was not simple since the movement is by using keys
as I mentioned..


这篇关于禁用一个图片框与另一个图片框的重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆