记得以前看到过,我给你说大概思路吧
把一些花的放到res资源文件中
注意,花的全部背景色要统一,便于去掉背景色(比如黑色)
运行时窗体自动全屏,设置窗体背景透明!设置透明色为黑色(和鲜花背景一样),然后在窗体上画图res中的花(随机,这样更漂亮)
'万花筒程序
'粘贴下面代码即可, 不用添加任何控件
Private WithEvents Timer1 As Timer
Dim r&, r1&, t&, a1!, a2!, xb!, yb!, s!, b#
Private Sub Form_Load()
MeWidth = 4500: MeHeight = 4500
MeMove (ScreenWidth - MeWidth) \ 2, (ScreenHeight - MeHeight) \ 2
MeAutoRedraw = True
MeCaption = "CBM666的万花筒"
Set Timer1 = ControlsAdd("vbtimer", "Timer1")
Timer1Interval = 10
End Sub
Private Sub Timer1_Timer()
Randomize
r = 340 Rnd
If r <> 0 Then
r1 = 500
s = r Rnd
b = RGB(256 Rnd, 256 Rnd, 256 Rnd)
For t = 1 To 10000
a1 = t 31415926 / 180
a2 = (r1 / r) a1
xb = 500 + (-(r1 - r) Cos(a1) - s Cos(a2 - a1) + 420) 4
yb = 500 + ((r1 - r) Sin(a1) - s Sin(a2 - a1) + 380) 4
MePSet (xb, yb), b
Next t
End If
End Sub
Case 6 To 9
adviseText = "早晨好"
Case 10
adviseText = "上午好"
Case 11 To 13
adviseText = "中午好"
Case 14 To 18
adviseText = "下午好"
Case 19 To 24
adviseText = "晚上好"
Case Else
adviseText = "凌晨了,还不去睡觉……"
欢迎分享,转载请注明来源:浪漫分享网
评论列表(0条)