https://www.myziyuan.com/
- zaijianshaoshi
- 1. 建议你还是不要自己写,可以通过直接用插件实现。2. 自己写会存在很多问题,会出现bug的
- 2021-03-23 18:00:01
- dsadasd
- Dim n As IntegerDim a()Private Sub Command1_Click() If n = 0 Then '第一次点击时执行 m = Val(Text1) ReDim a(1 To m) For i = 1 To m '生成数组a,元素为1至m这m个数 a(i) = i Next For i = 1 To m - 1 '随机打乱数组a中元素 r = Int(Rnd * m + 1) tmp = a(i) a(i) = a(r) a(r) = tmp Next End If n = n + 1 '计数点击次数 If n > Val(Text1) Then '次数超e69da5e887aae79fa5e9819331333337373666过指定次数,抽奖结束 MsgBox "抽奖结束!" Exit Sub End If Text2 = a(n) '从数组中抽出第n个数,由于数组中是随机排列,所以相当于生成一个随机数,并且不会重复End Sub
- 2021-02-12 12:08:45
- 111
- vf抽奖小程序,虽然你没给多少分,但还是告诉你吧,学者为先,答者为快,呵呵.以1到100个座位号来编吧按钮command1的caption首先设为"开始"文本框text1再画一个时间控制器timer1设置属性:interval值为2 enable值为.f.*双击timer1,并在time事件中输入如下代码:thisform.text1.value=int(rand()*100) &&产生100内的随机值thisform.text1.refresh &&刷新文本框*command1的click事件:if thisform.command1.caption="开始" &&检测按钮上的字 thisform.command1.caption="停止" &&变更铵钮上的字 thisform.timer1.enabled=.t. &&调用计时器事件 else thisform.command1.caption="开始" thisform.timer1.enabled=.f. &&关闭计时器事件 endif
- 2021-02-12 12:08:45