如何通过FileList
Box在Picture
Box显示图片!!!! 请问,我已经在FileList
Box现在了
图片文件列表,应该怎么做在单击其中一个
图片文件的时候,在Picture
Box立即
显示出来呢?? 还有应该怎么做才能 通过 “上一个” “下一个”的按钮来
显示filelist
Box中的
图片呢!!! 麻烦大家了!!!! __________________________________________________________________________ FileList
Box是什么控件? __________________________________________________________________________ 在单击的事件中写入 Me.Picture
Box1.Image = Image.FromFile( "含路径
文件名 ") 就行了。 __________________________________________________________________________ 这个“含路径
文件名”是通过点击filelist
Box下的
图片文件获得的!!要怎么获得呢??? __________________________________________________________________________ 我没用过FileList
Box这个控件,工具箱里没有噢。 __________________________________________________________________________ 不过您既然能把
文件加载到这个控件中那么应该可以用某种形式来保存他们的
文件名吧,实在不行就定义一个字符串数组,把
文件名保存在里面;用FileList
Box的Index值来匹配数组的Index,也可以的。 __________________________________________________________________________ FileList
Box是通过在工具箱中
添加/
删除项 来加入的!是用来
显示目录下的
文件~~ 我用 Me.Picture
Box1.Image = Image.FromFile( "FileList
Box1.Items.Strings[FileList
Box1.Itemindex] ") 还是不行 郁闷死了~~大家帮帮忙啊!! __________________________________________________________________________ 现在的问题是如何获得FileList
Box这个控件下的路径和
文件名,然后通过单击在Picture
Box下
显示!!! __________________________________________________________________________ 明明只有我一个在这儿么…… -_-||| __________________________________________________________________________ 晕掉了~~~没有知道么~~55555 __________________________________________________________________________ Public Class Form1 Private Sub Form1_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.Load Me.FileList
Box1.Path = "D:/My Documents/My Pictures " End Sub Private Sub FileList
Box1_SelectedIndexChanged(ByVal sender As Object,ByVal e As System.EventArgs) Handles FileList
Box1.SelectedIndexChanged Me.Picture
Box1.Image = Image.FromFile(Me.FileList
Box1.Path & "/ " & Me.FileList
Box1.Items(Me.FileList
Box1.SelectedIndex).ToString) End Sub End Class __________________________________________________________________________ Private Sub FileList
Box1_SelectedIndexChanged(ByVal sender As Object,ByVal e As System.EventArgs) Handles FileList
Box1.SelectedIndexChanged Me.Picture
Box1.Image = Image.FromFile(Me.FileList
Box1.Path & "/ " & Me.FileList
Box1.Items(Me.FileList
Box1.SelectedIndex).ToString) End Sub 用这个可以啦,呵呵。 __________________________________________________________________________ -_-|||,这样写好一点。 Private Sub FileList
Box1_SelectedIndexChanged(ByVal sender As Object,ByVal e As System.EventArgs) Handles FileList
Box1.SelectedIndexChanged Me.Picture
Box1.Image = Image.FromFile(Me.FileList
Box1.Path & "/ " & Me.FileList
Box1.SelectedItem.ToString) End Sub __________________________________________________________________________ 我刚才这么做 Me.Picture
Box1.Image = Image.FromFile(FileList
Box1.Path & " / " & FileList
Box1.FileName) 原来第二个忘记用select~~~~~郁闷~~~~~ 谢谢你啊!!!!呵呵!!分给你了!!!! __________________________________________________________________________
原文链接:https://www.f2er.com/vb/263813.html