这是一个图片浏览器的代码Dim JB As Integer
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End SubPrivate Sub Drive1_Change()
On Error GoTo ju
Dir1.Path = Drive1.Drive
Exit Sub
ju:
MsgBox "Drive not ready!"
Exit Sub
End Sub
Private Sub Command3_Click()
JB = 0
Call uppd
End SubSub uppd()
Frame1.Visible = True
Frame2.Visible = True
Frame3.Visible = True
Frame4.Visible = True
Frame5.Visible = True
Frame6.Visible = True
Frame7.Visible = True
Frame8.Visible = True
On Error GoTo balle1
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame1.Caption = File1.FileName
Image1.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle2
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame2.Caption = File.FileName
Image2.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle3
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame3.Caption = File.FileName
Image3.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle4
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame4.Caption = File.FileName
Image4.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle5
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame5.Caption = File.FileName
Image5.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle6
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame6.Caption = File.FileName
Image6.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle7
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame7.Caption = File.FileName
Image7.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle8
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame8.Caption = File.FileName
Image8.Picture = LoadPicture(nisse.Caption)
Exit Sub
balle1:
Frame1.Visible = False
Resume Next
Exit Sub
balle2:
Frame2.Visible = False
Resume Next
Exit Sub
balle3:
Frame3.Visible = False
Resume Next
Exit Sub
balle4:
Frame4.Visible = False
Resume Next
Exit Sub
balle5:
Frame5.Visible = False
Resume Next
Exit Sub
balle6:
Frame6.Visible = False
Resume Next
Exit Sub
balle7:
Frame7.Visible = False
Resume Next
Exit Sub
balle8:
Frame8.Visible = False
Resume Next
Exit Sub
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End SubPrivate Sub Drive1_Change()
On Error GoTo ju
Dir1.Path = Drive1.Drive
Exit Sub
ju:
MsgBox "Drive not ready!"
Exit Sub
End Sub
Private Sub Command3_Click()
JB = 0
Call uppd
End SubSub uppd()
Frame1.Visible = True
Frame2.Visible = True
Frame3.Visible = True
Frame4.Visible = True
Frame5.Visible = True
Frame6.Visible = True
Frame7.Visible = True
Frame8.Visible = True
On Error GoTo balle1
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame1.Caption = File1.FileName
Image1.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle2
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame2.Caption = File.FileName
Image2.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle3
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame3.Caption = File.FileName
Image3.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle4
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame4.Caption = File.FileName
Image4.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle5
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame5.Caption = File.FileName
Image5.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle6
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame6.Caption = File.FileName
Image6.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle7
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame7.Caption = File.FileName
Image7.Picture = LoadPicture(nisse.Caption)
On Error GoTo balle8
JB = JB + 1
File1.ListIndex = JB
File.ListIndex = JB
If Right(File.Path, 1) <> "\" Then
nisse.Caption = File1.Path & "\" & File1.FileName
Else
nisse.Caption = File1.Path & File1.FileName
End If
Frame8.Caption = File.FileName
Image8.Picture = LoadPicture(nisse.Caption)
Exit Sub
balle1:
Frame1.Visible = False
Resume Next
Exit Sub
balle2:
Frame2.Visible = False
Resume Next
Exit Sub
balle3:
Frame3.Visible = False
Resume Next
Exit Sub
balle4:
Frame4.Visible = False
Resume Next
Exit Sub
balle5:
Frame5.Visible = False
Resume Next
Exit Sub
balle6:
Frame6.Visible = False
Resume Next
Exit Sub
balle7:
Frame7.Visible = False
Resume Next
Exit Sub
balle8:
Frame8.Visible = False
Resume Next
Exit Sub
End Sub
解决方案 »
- datagrid中的bookmark如何使用
- vb 多表查询SQL语句
- 水晶报表都那么大.怎么给客户安装呀?我看9.0居然220兆???还有就是这个固定格式的报表如何用水晶报表实现?
- VB 关于TC35模块收发短信问题
- 同一ActiveX控件可否连接不同的数据源
- 感谢热心朋友,请fling_boy(男孩(QQ:81526768)) 和 feixuehenshui(飞雪恨水) 领分
- 高分求救一个简单的问题:如何在VB里实现数值四舍五入?
- 如何制作一个工具条,嵌入IE里面,并且随时随IE一起运行?
- 如何做类似于OICQ底部的按钮,会渐变颜色的那种?
- 关于的webclass疑问
- 用了魔鬼xp皮肤,单击任务栏(窗口底部,如窗口一、窗口二)的窗口不能最小化。。。
- 帮我看下这个程序的Datagrid控件哪里出了问题?
Frame8.Caption = File1.FileName 这样你看对不对?
楼主的不能显示,可能是缺少控件,窗体上需要有两个文件控件(File和File1),如果不用两个,把代码改了也应该可以显示