标题:[求助]问题出在哪了!?
只看楼主
tgllz
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2005-12-11
 问题点数:0 回复次数:1 
[求助]问题出在哪了!?

Function randint(inmin As Integer, inmax As Integer)
randint = Int(inmin - inmax + 1) * Rnd + inmin
End Function

Sub jump(ctl As Control)
Dim tom1 As Integer, tom2 As Integer
tom1 = randint(0, Width - ctl.Width)
tom2 = randint(0, Height - ctl.Height)
ctl.Move tom1, tom2
End Sub

Private Sub Command1_Click()
jump Command1
End Sub

Private Sub Command2_Click()
jump Command2
End Sub

Private Sub Form_Load()

End Sub

搜索更多相关主题的帖子: ctl 
2005-12-25 15:00
purana
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:广东-广州
等 级:版主
威 望:66
帖 子:6039
专家分:0
注 册:2005-6-17
得分:0 

Function randint(inmin As Integer, inmax As Integer)
Randomize
randint = Int(inmax - inmin + 1) * Rnd + inmin
End Function

Sub Jump(ctl As Control)
Dim tom1 As Integer, tom2 As Integer
tom1 = randint(0, Me.Width - ctl.Width)
tom2 = randint(0, Me.Height - ctl.Height)
ctl.Move tom1, tom2
End Sub

Private Sub Command1_Click()
Jump Command1
End Sub

Private Sub Command2_Click()
Jump Command2
End Sub


我的msn: myfend@
2005-12-25 16:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-39888-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.127111 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved