在vb编程中如何用语句判断点击的图片是给定的图片
3个回答
展开全部
靠 楼上的枪手 老子碰你好多次了
这个用遍历的算法做,这是我一个程序上面的,我只是截取下来的,可能还要做些兼容的工作
On Error GoTo Err:
Dim PathIndex(256) As Integer
Dim PIIndex As Integer
Dir.Path = "C:\"
PIIndex = 1
For b = 1 To 255
PathIndex(b) = 0
Next b
Returns:
SearchingNow.Caption = AddL(Dir.Path, "\")
If Paused Then
SearchingNow.Caption = ""
Exit Sub
End If
SearchDir
DoEvents
Reback:
If PathIndex(PIIndex) <= Dir.ListCount - 1 Then
Dir.Path = Dir.List(PathIndex(PIIndex))
PIIndex = PIIndex + 1
PathIndex(PIIndex) = 0
GoTo Returns
Else
If Dir.Path <> GoBack(Dir.Path) Then
Dir.Path = GoBack(Dir.Path)
PIIndex = PIIndex - 1
PathIndex(PIIndex) = PathIndex(PIIndex) + 1
If PathIndex(PIIndex) > Dir.ListCount - 1 Then GoTo Reback
Dir.Path = Dir.List(PathIndex(PIIndex))
PIIndex = PIIndex + 1
PathIndex(PIIndex) = 0
GoTo Returns
End If
End If
Exit Sub
Err:
MsgBox "搜索磁盘出现错误。" + Err.Description + "(" + CStr(Err.Number) + ")。vbCritical + vbOKOnly, "搜索错误"
这个用遍历的算法做,这是我一个程序上面的,我只是截取下来的,可能还要做些兼容的工作
On Error GoTo Err:
Dim PathIndex(256) As Integer
Dim PIIndex As Integer
Dir.Path = "C:\"
PIIndex = 1
For b = 1 To 255
PathIndex(b) = 0
Next b
Returns:
SearchingNow.Caption = AddL(Dir.Path, "\")
If Paused Then
SearchingNow.Caption = ""
Exit Sub
End If
SearchDir
DoEvents
Reback:
If PathIndex(PIIndex) <= Dir.ListCount - 1 Then
Dir.Path = Dir.List(PathIndex(PIIndex))
PIIndex = PIIndex + 1
PathIndex(PIIndex) = 0
GoTo Returns
Else
If Dir.Path <> GoBack(Dir.Path) Then
Dir.Path = GoBack(Dir.Path)
PIIndex = PIIndex - 1
PathIndex(PIIndex) = PathIndex(PIIndex) + 1
If PathIndex(PIIndex) > Dir.ListCount - 1 Then GoTo Reback
Dir.Path = Dir.List(PathIndex(PIIndex))
PIIndex = PIIndex + 1
PathIndex(PIIndex) = 0
GoTo Returns
End If
End If
Exit Sub
Err:
MsgBox "搜索磁盘出现错误。" + Err.Description + "(" + CStr(Err.Number) + ")。vbCritical + vbOKOnly, "搜索错误"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询