Visual Basic 6标签随机移动 [英] Visual basic 6 movement of label randomly

查看:178
本文介绍了Visual Basic 6标签随机移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用单个计时器控件在表单中随机移动标签?

how to make a label move randomly in a form using a single timer control ?

推荐答案

计时器刻度事件 [ ^ ]

生成两个随机长片 - VB6中的随机数 [ ^ ]

将label.Top和label.Left设置为这些数字。

提示 - 您应该验证数字代表一个可见的位置你的屏幕/表格。
In the timer tick event[^]
Generate two random longs - Random numbers in VB6[^]
Set the label.Top and label.Left to these numbers.
Hint - you should validate that the numbers represent a position that is visible on your screen/form first.


这篇关于Visual Basic 6标签随机移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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