vf抽奖小程序

来源:百度知道 编辑:UC知道 时间:2024/06/01 03:17:52
大家好 我需要一个随机抽取座位号的小程序 用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