怎样用VB做一个图片浏览器?? 30

要求有自动播放功能,浏览上一页,下一页,并且显示图片张数~控件的代码是什么`???... 要求有自动播放功能,浏览上一页,下一页,
并且显示图片张数~
控件的代码是什么`???
展开
 我来答
路过的空虚者
2014-01-18 · TA获得超过948个赞
知道小有建树答主
回答量:215
采纳率:100%
帮助的人:85.5万
展开全部
Public Class Form1
Dim i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
i = i - 1
If (i < 0) Then
i = 4
End If

'pic.Image = imgl.Images(i)
pic.Image = Image.FromFile(imgNames(i).FullName)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

i = i + 1
If (i >= 4) Then
i = 0
End If

'pic.Image = imgl.Images(i)
pic.Image = Image.FromFile(imgNames(i).FullName)

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If Button3.Text Is "播放" Then
Timer1.Start()
Button3.Text = "暂停"

Else
Timer1.Stop()
Button3.Text = "播放"

End If

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i = i + 1
If (i >= 4) Then
i = 0
End If
'pic.Image = imgl.Images(i)
pic.Image = Image.FromFile(imgNames(i).FullName)

End Sub

Dim imgNames As IO.FileInfo()
Private Sub test2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim _Url As String
_Url = Application.StartupPath & "\Imager" '获取程序文件信息所在的文件夹

Dim _ImgUrl As New System.IO.DirectoryInfo(_Url) '新建文件夹对象

imgNames = _ImgUrl.GetFiles("*.jpg") '从文件信息中获取文件对象的类型

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

FolderBrowserDialog1.ShowDialog()

Dim _Url As String
_Url = FolderBrowserDialog1.SelectedPath

Dim _ImgUrl As New System.IO.DirectoryInfo(_Url) '新建文件夹对象

imgNames = _ImgUrl.GetFiles("*.jpg") '从文件信息中获取文件对象的类型

End Sub
Dim form As New Form2

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles form2Click.Click
Form.Show() '*************显示窗体
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Me.Close()
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
form.Close()
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim clockF As New clock
clockF.ShowDialog()
End Sub
End Class

显示张数的用text显示出来就可以了

其实我也是初学者这些代码有些小BUG请包涵我会修改的

大家可以加个QQ交流交流
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友a7cb9e4ff
2007-03-22 · TA获得超过116个赞
知道小有建树答主
回答量:330
采纳率:100%
帮助的人:321万
展开全部
1、用Picture显示图片

2、用Timer做自动轮换图片功能

3、还有重要的就是取得图片文件列表放进结构数组就可以了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式