第1个回答 推荐于2018-03-14
Dim num, sum, it(1), n, t, h
Private Sub Form_Click()
File1.Refresh
sum = 0
List1.Clear
For i = 0 To File1.ListCount - 1
t = Split(File1.List(i), ".")(UBound(Split(File1.List(i), ".")))
If LCase(t) = LCase("jpg") Or LCase(t) = LCase("bmp") Or LCase(t) = LCase("gif") Then List1.AddItem File1.List(i): sum = sum + 1
Next
h = Rnds(sum)
Print h
Image1.Picture = LoadPicture(List1.List(h))
End Sub
Private Sub Form_Load()
File1.Visible = 0
List1.Visible = 0
num = -1
End Sub
Function Rnds(ByVal Value)
re:
DoEvents
Randomize
n = Fix(Rnd * Value)
If num = 1 Then num = -1
num = num + 1
it(num) = n
If it(0) = it(1) Then GoTo re
Rnds = n
End Function
'添加image1、file1、list1控件各一个本回答被提问者和网友采纳
第2个回答 2011-03-07
.com
压缩包中有4个目录
1中是 前两个syA_1,syA_3
2中是 后面接着的三个syA_1,syA_2,syA_3
三角形 就是判断三角形的
随机数 就是生成随机数并判断的。
请给分,谢谢!!