Randomize
RandNum = Int((3 - 1 + 1) * Rnd + 1)
Picture1.Picture = ImageList1.ListImages(RandNum).Picture
End Sub
可以帮偶看看吗?图片那里偶已经设置成空件数组的形式,这样有错吗?可是程序运行不了,老说没有找到方法或数据成员??????????
Dim RandNum As Integer
Sub ProRandNum()
Randomize
RandNum = Int((3 - 1 + 1) * Rnd + 1)
Picture1.Picture = ImageList1.ListImages(RandNum).Picture
End Sub
Private Sub Command1_Click()
Picture1.Visible = True
ProRandNum
Select Case RandNum
Case 1
Label1.Caption = Command1.Caption
Case 2
Label1.Caption = Command1.Caption
Label2.Caption = Val(Label2.Caption) + 1
Label3.Caption = Val(Label3.Caption) + 0
Case 3
Label1.Caption = Command1.Caption
Label2.Caption = Val(Label2.Caption) + 0
Label3.Caption = Val(Label3.Caption) + 1
End Select
End Sub
Private Sub Command2_Click()
Picture1.Visible = True
ProRandNum
Label1.Caption = Command2.Caption
Select Case RandNum
Case 1
Label1.Caption = Command2.Caption
Label2.Caption = Val(Label2.Caption) + 0
Label3.Caption = Val(Label3.Caption) + 1
Case 2
Label1.Caption = Command2.Caption
Case 3
Label1.Caption = Command2.Caption
Label2.Caption = Val(Label2.Caption) + 1
Label3.Caption = Val(Label3.Caption) + 0
End Select
End Sub
Private Sub Command3_Click()
Picture1.Visible = True
ProRandNum
Label1.Caption = Command3.Caption
Select Case RandNum
Case 1
Label1.Caption = Command3.Caption
Label2.Caption = Val(Label2.Caption) + 1
Label3.Caption = Val(Label3.Caption) + 0
Case 2
Label1.Caption = Command3.Caption
Label2.Caption = Val(Label2.Caption) + 1
Label3.Caption = Val(Label3.Caption) + 0
Case 3
Label1.Caption = Command3.Caption
End Select
End Sub
Private Sub Command4_Click()
Label2 = "0"
Label3 = "0"
Picture1.Visible = False
Label1 = ""
End Sub