vb高手进。帮帮忙,两个程序,急!在线等!
第一个是text框里出现十个随即数,然后用函数过程求该十个数的平均数,显示在label框内第二个是利用定时器做霓虹灯非常感谢啊。。各位!比较急。。菜鸟飘过!...
第一个是 text框里出现十个随即数,然后用函数过程求该十个数的平均数,显示在label框内
第二个是利用定时器做霓虹灯
非常感谢啊。。各位!比较急。。菜鸟飘过! 展开
第二个是利用定时器做霓虹灯
非常感谢啊。。各位!比较急。。菜鸟飘过! 展开
1个回答
展开全部
No.1
Private Sub Command1_Click()
Call ToDo(Text1, Label1)
End Sub
Private Sub ToDo(T1 As TextBox, L1 As Label)
Dim I, Sum As Integer
Dim StrNum As String
Dim X
Randomize
For I = 1 To 10
StrNum = StrNum & Int(Rnd * 10 + 1) & " "
Next
T1 = StrNum
For Each X In Split(StrNum, " ")
Sum = Sum + Val(X)
Next
L1 = Sum / 10
End Sub
NO.2
一个Timer,一个Label
Private Sub Form_Load()
Timer1.Interval = 200
Timer1.Enabled = True
Label1.Caption = ""
End Sub
Private Sub Timer1_Timer()
Randomize
Label1.BackColor = RGB(Int(Rnd * 256), Int(Rnd * 256), Int(Rnd * 256))
End Sub
Private Sub Command1_Click()
Call ToDo(Text1, Label1)
End Sub
Private Sub ToDo(T1 As TextBox, L1 As Label)
Dim I, Sum As Integer
Dim StrNum As String
Dim X
Randomize
For I = 1 To 10
StrNum = StrNum & Int(Rnd * 10 + 1) & " "
Next
T1 = StrNum
For Each X In Split(StrNum, " ")
Sum = Sum + Val(X)
Next
L1 = Sum / 10
End Sub
NO.2
一个Timer,一个Label
Private Sub Form_Load()
Timer1.Interval = 200
Timer1.Enabled = True
Label1.Caption = ""
End Sub
Private Sub Timer1_Timer()
Randomize
Label1.BackColor = RGB(Int(Rnd * 256), Int(Rnd * 256), Int(Rnd * 256))
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询