显示图片
代码:
- Dim path As String = "d:/我的文档/桌面/002.jpg"
- 'PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage '使图片自动适应Picturebox控件
- PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize '使Picturebox控件自动适应图片
- PictureBox1.Image = Image.FromFile(path)
驱动器与文件列表
控件:DirListBox,DriveListBox (需要从"工具"----"选择工具箱"中添加)
代码:
- Private Sub DriveListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriveListBox1.SelectedIndexChanged
- DirListBox1.Path = DriveListBox1.Drive
- End Sub
本文介绍如何使用VB.NET编程语言实现图片显示,并通过PictureBox控件调整图片大小以适应界面。此外,还展示了如何利用DriveListBox和DirListBox控件进行驱动器及目录的选择。
3058

被折叠的 条评论
为什么被折叠?



