[VB.NET]如何通过FileListBox在PictureBox显示图片!!!!
来源:互联网 发布:淘宝店铺转让 编辑:程序博客网 时间:2024/04/28 02:20
<script type="text/javascript"><!--google_ad_client = "pub-8333940862668978";/* 728x90, 创建于 08-11-30 */google_ad_slot = "4485230109";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
如何通过FileListBox在PictureBox显示图片!!!!
请问,我已经在FileListBox现在了图片文件列表,应该怎么做在单击其中一个图片文件的时候,在PictureBox立即显示出来呢??
还有应该怎么做才能 通过 “上一个” “下一个”的按钮来显示filelistbox中的图片呢!!!
麻烦大家了!!!!
__________________________________________________________________________
FileListBox是什么控件?
__________________________________________________________________________
在单击的事件中写入
Me.PictureBox1.Image = Image.FromFile( "含路径文件名 ")
就行了。
__________________________________________________________________________
这个“含路径文件名”是通过点击filelistbox下的图片文件获得的!!要怎么获得呢???
__________________________________________________________________________
我没用过FileListBox这个控件,工具箱里没有噢。
__________________________________________________________________________
不过您既然能把文件加载到这个控件中那么应该可以用某种形式来保存他们的文件名吧,实在不行就定义一个字符串数组,把文件名保存在里面;用FileListBox的Index值来匹配数组的Index,也可以的。
__________________________________________________________________________
FileListBox是通过在工具箱中添加/删除项 来加入的!是用来显示目录下的文件~~
我用
Me.PictureBox1.Image = Image.FromFile( "FileListBox1.Items.Strings[FileListBox1.Itemindex] ")
还是不行 郁闷死了~~大家帮帮忙啊!!
__________________________________________________________________________
现在的问题是如何获得FileListBox这个控件下的路径和文件名,然后通过单击在PictureBox下显示!!!
__________________________________________________________________________
明明只有我一个在这儿么…… -_-|||
__________________________________________________________________________
晕掉了~~~没有知道么~~55555
__________________________________________________________________________
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.FileListBox1.Path = "D:/My Documents/My Pictures "
End Sub
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Me.PictureBox1.Image = Image.FromFile(Me.FileListBox1.Path & "/ " & Me.FileListBox1.Items(Me.FileListBox1.SelectedIndex).ToString)
End Sub
End Class
__________________________________________________________________________
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Me.PictureBox1.Image = Image.FromFile(Me.FileListBox1.Path & "/ " & Me.FileListBox1.Items(Me.FileListBox1.SelectedIndex).ToString)
End Sub
用这个可以啦,呵呵。
__________________________________________________________________________
-_-|||,这样写好一点。
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Me.PictureBox1.Image = Image.FromFile(Me.FileListBox1.Path & "/ " & Me.FileListBox1.SelectedItem.ToString)
End Sub
__________________________________________________________________________
我刚才这么做
Me.PictureBox1.Image = Image.FromFile(FileListBox1.Path & " / " & FileListBox1.FileName)
原来第二个忘记用select~~~~~郁闷~~~~~
谢谢你啊!!!!呵呵!!分给你了!!!!
__________________________________________________________________________
如何通过FileListBox在PictureBox显示图片!!!!
请问,我已经在FileListBox现在了图片文件列表,应该怎么做在单击其中一个图片文件的时候,在PictureBox立即显示出来呢??
还有应该怎么做才能 通过 “上一个” “下一个”的按钮来显示filelistbox中的图片呢!!!
麻烦大家了!!!!
__________________________________________________________________________
FileListBox是什么控件?
__________________________________________________________________________
在单击的事件中写入
Me.PictureBox1.Image = Image.FromFile( "含路径文件名 ")
就行了。
__________________________________________________________________________
这个“含路径文件名”是通过点击filelistbox下的图片文件获得的!!要怎么获得呢???
__________________________________________________________________________
我没用过FileListBox这个控件,工具箱里没有噢。
__________________________________________________________________________
不过您既然能把文件加载到这个控件中那么应该可以用某种形式来保存他们的文件名吧,实在不行就定义一个字符串数组,把文件名保存在里面;用FileListBox的Index值来匹配数组的Index,也可以的。
__________________________________________________________________________
FileListBox是通过在工具箱中添加/删除项 来加入的!是用来显示目录下的文件~~
我用
Me.PictureBox1.Image = Image.FromFile( "FileListBox1.Items.Strings[FileListBox1.Itemindex] ")
还是不行 郁闷死了~~大家帮帮忙啊!!
__________________________________________________________________________
现在的问题是如何获得FileListBox这个控件下的路径和文件名,然后通过单击在PictureBox下显示!!!
__________________________________________________________________________
明明只有我一个在这儿么…… -_-|||
__________________________________________________________________________
晕掉了~~~没有知道么~~55555
__________________________________________________________________________
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.FileListBox1.Path = "D:/My Documents/My Pictures "
End Sub
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Me.PictureBox1.Image = Image.FromFile(Me.FileListBox1.Path & "/ " & Me.FileListBox1.Items(Me.FileListBox1.SelectedIndex).ToString)
End Sub
End Class
__________________________________________________________________________
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Me.PictureBox1.Image = Image.FromFile(Me.FileListBox1.Path & "/ " & Me.FileListBox1.Items(Me.FileListBox1.SelectedIndex).ToString)
End Sub
用这个可以啦,呵呵。
__________________________________________________________________________
-_-|||,这样写好一点。
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
Me.PictureBox1.Image = Image.FromFile(Me.FileListBox1.Path & "/ " & Me.FileListBox1.SelectedItem.ToString)
End Sub
__________________________________________________________________________
我刚才这么做
Me.PictureBox1.Image = Image.FromFile(FileListBox1.Path & " / " & FileListBox1.FileName)
原来第二个忘记用select~~~~~郁闷~~~~~
谢谢你啊!!!!呵呵!!分给你了!!!!
__________________________________________________________________________
- [VB.NET]如何通过FileListBox在PictureBox显示图片!!!!
- [VB.NET].NET精简框架下用VB.NET怎么实现在picturebox上显示不同图片???
- [VB.NET]如何把一个图片保存到access中,又如何把它读取出来,并在picturebox中显示?
- [VB.NET]请问如何在picturebox中实现幻灯片查看图片效果
- 通过VB显示QQ网页登录时代校验码图,并显示在picturebox控件中(通过vb显示网页中的图片)
- [VB.NET]如何判断两个picturebox里的图片相同
- WinCE如何使用PictureBox的Image属性通过图片路径显示图片
- 让图片显示在PictureBox里
- C#将数据库图片显示在pictureBox
- C# 通过URL获取图片并显示在PictureBox上的方法
- C# 通过URL获取图片并显示在PictureBox上的方法
- C# 通过URL获取图片并显示在PictureBox上的方法
- [VB.NET]PictureBox 存储
- VB.net基础:如何获得并显示网上图片
- VB.net基础:如何获得并显示网上图片
- VB.NET Winform显示保存在数据库中的图片
- 怎样把网上的图片显示在PictureBox中
- 将图片显示在picturebox中的几个方法
- [VB.NET]OLEDB.4.0连接ACCESS,怎么改成SQL SERVER数据库?
- Tomcat Mysql datasource 数据源配置
- [VB.NET]求个修改和删除代码??
- [VB.NET]MDI窗体
- [VB.NET]VB中有可以自动增加大小的类吗?
- [VB.NET]如何通过FileListBox在PictureBox显示图片!!!!
- Java编程那些事儿57—面向对象基础
- [VB.NET]将VB中文档写入Word时出现的错误,帮忙解决一下,谢谢
- [VB.NET]求救.速度.!帮忙写点东西.!
- [VB.NET]VB.NET生成的EXE文件在我的电脑上能运行,但是放到其他的电脑上就不行了?
- level set 介绍3
- [VB.NET]初始化PictureBox数组怎么操作
- [VB.NET]如何将TEXT中的文字导入到Word?知道的进下
- [VB.NET]winform ComboBox数据绑定问题