| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 614 人关注过本帖
标题:[原创]一个倒计时程序。时间到后会有雪花效果
只看楼主 加入收藏
maui2000
Rank: 1
等 级:新手上路
威 望:1
帖 子:113
专家分:0
注 册:2006-5-23
收藏
 问题点数:0 回复次数:0 
[原创]一个倒计时程序。时间到后会有雪花效果

Dim Snow(1000, 2), Amounty As Integer

'Public Function a()
' a = #11/23/2004#
'End Function
Public Function b()
b = Now
End Function
Private Sub Form_Load()
a = #5/28/2006#
Label1.Caption = Now
Label2.Caption = DateDiff("d", Now, a) - 1 & "天"
Label3.Caption = 23 - Hour(b) & "小时"
Label4.Caption = 59 - Minute(b) & "分钟"
Label5.Caption = 60 - Second(b) & "秒"
If DateDiff("d", Now, a) < 1 Then
Label2.Caption = 0 & "天"
End If
If b >= #5/28/2006 11:59:59 PM# Then
Label3.Caption = 0 & "小时"
Label4.Caption = 0 & "分钟"
Label5.Caption = 0 & "秒"
Command1.Visible = True
Else
Command1.Visible = False
End If
End Sub
Private Sub Command1_Click()
Dim response
response = MsgBox("消息", vbYesNo + vbQuestion, "提示")
If response = 6 Then
response = MsgBox("消息", vbExclamation, "提示")
ElseIf response = 7 Then
response = MsgBox("消息", vbExclamation, "提示")
End If
'雪花效果
Form1.Show
DoEvents
Randomize
Amounty = 325
For J = 1 To Amounty
Snow(J, 0) = Int(Rnd * Form1.Width)
Snow(J, 1) = Int(Rnd * Form1.Height)
Snow(J, 2) = 10 + (Rnd * 20)
Next J
Do While Not (DoEvents = 0)
For LS = 1 To 10
For I = 1 To Amounty
Snow(I, 1) = Snow(I, 1) + Snow(I, 2)
If Snow(I, 1) > Form1.Height Then
Snow(I, 1) = 0: Snow(I, 2) = 2 + (Rnd * 30)
Snow(I, 0) = Int(Rnd * Form1.Width)
End If
Circle (Snow(I, 0), Snow(I, 1)), 15 * Rnd, RGB(255, 255, 255)
Next I
Form1.Cls
Next LS
Loop
End
End Sub

Private Sub Timer1_Timer()
Label1.Caption = Now
Form_Load
End Sub



需要一个时间控件,再就是几个label

其中时间我做成定死了的,可以变成输入形式
主要是做出来给别人做生日礼物的。呵呵~~~~~~

[此贴子已经被作者于2006-6-9 16:32:43编辑过]

搜索更多相关主题的帖子: 雪花 倒计时 Function 效果 
2006-06-09 16:31
快速回复:[原创]一个倒计时程序。时间到后会有雪花效果
数据加载中...
 
   



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

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