- Код: Выделить всё
Try
If FolderBrowserDialog1.ShowDialog() = DialogResult.OK Then
Dim _dirInfo As New System.IO.DirectoryInfo(FolderBrowserDialog1.SelectedPath)
Dim _Files() As System.IO.FileInfo = _dirInfo.GetFiles(ExFiles)
Dim _file As System.IO.FileInfo
Dim bit As Bitmap
If Not (_Files Is Nothing) Then
For Each _file In _dirInfo.GetFiles("*.jpg")
Dim _pic As System.Windows.Forms.PictureBox
Static x As Integer
Static y As Integer
_pic = New PictureBox
_pic.SetBounds(x, y, 100, 100)
_pic.BorderStyle = BorderStyle.Fixed3D
_pic.SizeMode = PictureBoxSizeMode.StretchImage
_pic.Image = Image.FromFile(_file.FullName)
bit = New Bitmap(_file.FullName)
_pic.Name = _file.FullName
y += 100
If _pic.Bounds.Y >= Me.Height Then
x += 100
y = 0
End If
Me.Controls.Add(_pic)
AddHandler _pic.DoubleClick, AddressOf _click
Next
Me.AutoScroll = True
End If
End If
Catch ex As Exception
Exit Sub
End Try