vb.net图片浏览器 vbs打开图片

怎样用vb.net做一个图片浏览器?在自定义工具箱中选择dirlistboxvb.net图片浏览器 , drivelistboxvb.net图片浏览器,filelistbox,添加这3个控件 , 然后在窗体上添加这些控件和一个picturebox控件,代码如下:
Public Class Form1
Private Sub DirListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DirListBox1.SelectedIndexChanged
FileListBox1.Path = DirListBox1.Path
End Sub
Private Sub DriveListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DriveListBox1.SelectedIndexChanged
DirListBox1.Path = DriveListBox1.Drive
End Sub
Private Sub FileListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileListBox1.SelectedIndexChanged
PictureBox1.Image = Image.FromFile(FileListBox1.Path + "\" + FileListBox1.SelectedItem.ToString())
End Sub
End Class
你可以自己在修改下,这只是个模型 , 呵呵!
vb.net编写一个照片浏览器程序,程序执行时单击下一张,将会显示下一张照片vb.net图片浏览器我说选把打开多个图片路径加载到一个listbox里vb.net图片浏览器,利用listbox写代码
Private Sub picbox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If ListBox1.SelectedIndex = count Then
Try
ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
Catch
ListBox1.SelectedIndex = 0
End Try
End If
picbox.Image = ListBox1.SelectedItem.ToString
End Sub
用vb.net如何编写图片浏览器的基本步骤功能是:图片的打开、显示、缩放、旋转 。窗体上放一个PictureBox,两个CommandButton,一个FileListBox
Private Sub Command1_Click()
If File1.ListIndex = 0 Then
ShowPic File1.ListCount - 1
Else
ShowPic File1.ListIndex - 1
End If
End Sub
Private Sub Command2_Click()
If File1.ListIndex = File1.ListCount - 1 Then
ShowPic 0
Else
ShowPic File1.ListIndex + 1
End If
End Sub
Private Sub Form_Load()
File1.Visible = False
File1.Pattern = "*.jpg;*.gif" '可以浏览的文件类型,使用分号隔开
File1.Path = App.Path '改成你需要浏览的目录,比如"C:\Pic"
If File1.ListCount1 Then '目录中图片在两张以上可以浏览
ShowPic 0
Exit Sub
ElseIf File1.ListCount = 1 Then '目录中只有一张图片时只显示这一张
ShowPic 0
End If
Command1.Enabled = False
Command2.Enabled = False
End Sub
Private Sub ShowPic(Index As Long)
File1.ListIndex = Index
Picture1.Picture = LoadPicture(File1.Path"\"File1.List(Index))
【vb.net图片浏览器 vbs打开图片】End Sub
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
vaela
vb.net图片浏览器的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vbs打开图片、vb.net图片浏览器的信息别忘了在本站进行查找喔 。