
怎样通过单击filelist 中的图片在image中打开?谢谢
Sub File1_CLICK()
If Right(File1.path) <> "\" then
File1.Path = File1.Path + "薯拍\"
End if
Image1.Image = LoadPictrue(File1.Path & File1.FIleName)
END SUB
先读取FileList的图片路径,确定Path以"\"结尾防止出现“C:\\1.bmp”的情哗手敬况;然后用LoadPictrue给乱慎Image1的Image属性赋值。
应该再加一纯芹缓个驱动器列表框和一个目录列表框,程做模序如下:
Private File1_Click()
Dim FileName As String
If Right(Dir1.Path,1)="\" Then
FileName=Dir1.Path & File1.FileName
Else
FileName=Dir1.Path & "\"首雀 & File1.FileName
End If
Image1.Picture=LoadPicture(FileName)
End Sub
Private Sub Dir1_Change()
File1.Path=Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path=Drive1.Drive
End Sub