Option Explicit
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dim r As VbMsgBoxResult
On Error GoTo eh
Dir1.Path = Drive1.Drive
Exit Sub
eh:
If Err.Number = 68 Then
r = MsgBox("请插入磁盘!", vbRetryCancel + vbCritical, "缺少磁盘!")
If r = vbRetry Then
Resume
Else
Drive1.Drive = "c:"
Resume Next
End If
End If
End Sub
Private Sub File1_Click()
If Option2.Value = True Then Exit Sub
Dim picfile As String
If Right(Dir1.Path, 1) = "\" Then
picfile = Dir1.Path + File1.FileName
Else
picfile = Dir1.Path + "\" + File1.FileName
End If
Image1.Picture = LoadPicture(picfile)
Text1.Text = File1.FileName
End Sub
Private Sub File1_DblClick()
If Option1.Value = True Then Exit Sub
Dim picfile As String
If Right(Dir1.Path, 1) = "\" Then
picfile = Dir1.Path + "\" + File1.FileName
End If
Image1.Picture = LoadPicture(picfile)
Text1.Text = File1.FileName
End Sub