如何在表格周围移动btn [英] How move btn around the form

查看:77
本文介绍了如何在表格周围移动btn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按钮最初位于最左侧,对角线朝向右下方,直到它到达下边缘,然后以相同的方向反弹,等等......



我尝试了什么:



The button is initially located at the far left and diagonally oriented towards the bottom right until it reaches the lower edge and then rebounds in the same direction and so on ..

What I have tried:

You try to work on a timer so that an event is triggered when the button reaches the edge and the button movement is reversed by the selected destination

推荐答案

计时器可以解决问题。在计时器事件处理程序中,根据当前速度和位置更新按钮位置。在到达右下角位置时,反转按钮速度。
The timer would do the trick. In the timer event handler update the button position based on current speed and position. On reaching the bottom-right position, invert the button speed.


这篇关于如何在表格周围移动btn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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