picturebox控件显示图片问题?

flytrap1 2002-05-20 03:02:00
drive dirlist filelist picturebox 四个控件

运行时想要点击filelist中的jpg文件 picturebox能马上显示出来。
...全文
37 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
pl5th2001 2002-05-20
  • 打赏
  • 举报
回复
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1
End Sub

Private Sub File1_Click()
Picture1.Picture = LoadPicture(Dir1 & "\" & File1.FileName)

End Sub
footballboy 2002-05-20
  • 打赏
  • 举报
回复
现编了一个,你自己完善吧
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
If Right$(Dir1.Path, 1) <> "\" Then
Picture1.Picture = LoadPicture(Dir1.Path & "\" & File1.FileName)
Else
Picture1.Picture = LoadPicture(Dir1.Path & File1.FileName)
End If
End Sub

Private Sub Form_Load()
File1.Pattern = "*.jpg"
End Sub
footballboy 2002-05-20
  • 打赏
  • 举报
回复
现编了一个,自己完善吧
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
If Right$(Dir1.Path, 1) <> "\" Then
Picture1.Picture = LoadPicture(Dir1.Path & "\" & File1.FileName)
Else
Picture1.Picture = LoadPicture(Dir1.Path & File1.FileName)
End If
End Sub

Private Sub Form_Load()
File1.Pattern = "*.jpg"
End Sub
COOL099 2002-05-20
  • 打赏
  • 举报
回复
Option Explicit

Private Sub Dir1_Change()
File1.Path = Dir1.Path

End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
Set Picture1.Picture = LoadPicture(Dir1.Path & "\" & File1.FileName)
End Sub

jokingjun 2002-05-20
  • 打赏
  • 举报
回复
在filelist_click中加入
picture1.picture=loadpicture("filelist1.filename")
tony_jian 2002-05-20
  • 打赏
  • 举报
回复
picture1.loadpicture 路径

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧