仅在面板内移动对象

仅在面板内移动对象

本文介绍了仅在面板内移动对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我在C#中有一个包含两个面板的项目.第一面板不可调整大小或移动.第二个是相当大且可移动的.我希望第二个面板仅在第一个面板内部移动,并且当其边界与另一个面板相等时停止移动.

现在,当我移动第二个面板时,在通过第一个面板的边界并检查其坐标后,例如左= -20或顶部= -30,它恰好消失在第一个面板后面的某个地方.

请帮忙.谢谢.

Dear friends,

I have a project in C# with two panels. The first panel is not resizeble or movable. The second one is sizeable and movable. I want the second panel to move only inside the first panel, and when it''s borders are equal to the other panel, to stop moving.

When I move the second panel now, after passing the border of the first one and checking its coordinates, they are for example left = -20 or top = -30, it happens to dissapear somewhere behind the first panel.

Please help. Thank you.

推荐答案


这篇关于仅在面板内移动对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 02:10