显示图片
代码:
- 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