如何把VB程序应用到屏保程序中
我用VB编写了一个简单的下雪场景,如何让它应用到我的屏保程序中,我的系统是windowsXP程序在这,你帮看一下DimSnow(1000,2),AmountyAsInte...
我用VB编写了一个简单的下雪场景,如何让它应用到我的屏保程序中,我的系统是windows XP
程序在这,你帮看一下
Dim Snow(1000, 2), Amounty As Integer
Private Sub Form_Load()
form1.Show
DoEvents
Randomize
Amounty = 500
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
OldX = Snow(I, 0): OldY = Snow(I, 1)
Snow(I, 1) = Snow(I, 1) + Snow(I, 2)
If Snow(I, 1) > form1.Height Then
Snow(I, 1) = 0: Snow(I, 2) = 5 + (Rnd * 30)
Snow(I, 0) = Int(Rnd * form1.Width)
OldX = 0: OldY = 0
End If
Coloury = 8 * (Snow(I, 2) - 10): Coloury = 60 + Coloury
PSet (OldX, OldY), QBColor(0)
PSet (Snow(I, 0), Snow(I, 1)), RGB(Coloury, Coloury, Coloury)
Next I
Next LS
Loop
End
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload Me
End Sub 展开
程序在这,你帮看一下
Dim Snow(1000, 2), Amounty As Integer
Private Sub Form_Load()
form1.Show
DoEvents
Randomize
Amounty = 500
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
OldX = Snow(I, 0): OldY = Snow(I, 1)
Snow(I, 1) = Snow(I, 1) + Snow(I, 2)
If Snow(I, 1) > form1.Height Then
Snow(I, 1) = 0: Snow(I, 2) = 5 + (Rnd * 30)
Snow(I, 0) = Int(Rnd * form1.Width)
OldX = 0: OldY = 0
End If
Coloury = 8 * (Snow(I, 2) - 10): Coloury = 60 + Coloury
PSet (OldX, OldY), QBColor(0)
PSet (Snow(I, 0), Snow(I, 1)), RGB(Coloury, Coloury, Coloury)
Next I
Next LS
Loop
End
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Unload Me
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询