im making a program that will create a new button for every file in a directory(my pictures) and the background image for the button will be the picture...but when i run it i get an out of memory error...here is the code
Dim dir As New DirectoryInfo(M y.Computer.File System.SpecialD irectories.MyPi ctures)
Dim f As FileInfo
For Each f In dir.GetFiles
Dim newbutton As New Button
'below is where the problem is'
newbutton.Backg roundImage = Image.FromFile( f.FullName)
newbutton.Text = f.Name
Me.Controls.Add (newbutton)
Next f
Dim dir As New DirectoryInfo(M y.Computer.File System.SpecialD irectories.MyPi ctures)
Dim f As FileInfo
For Each f In dir.GetFiles
Dim newbutton As New Button
'below is where the problem is'
newbutton.Backg roundImage = Image.FromFile( f.FullName)
newbutton.Text = f.Name
Me.Controls.Add (newbutton)
Next f
Comment